Periodic functions/Rational ratio of lengths/Sum periodic/Exercise

Let

be periodic functions with periods respectively and . The quotient is a rational number. Prove that is also a periodic function.