Let $f$ and $g$ two periodic function two non-constant periodic continuous functions of $\mathbb{R}\rightarrow\mathbb{R}$. Note $a>0$ the smallest period of f and $b$ the smallest period of g.
Find a necessary and sufficient condition for f + g is periodic.
Notice that If $b$ is a multiple of $a$, then $f+g$ is clearly periodic.
Plus, she $\frac{a}b \in \mathbb{Q}$, where $\frac{a}b=\frac{p}q$ then $aq=bp$ is clearly a period of $\quad f+g$
This condition is actually necessary.
Proof.
By contradiction, assume $\frac{a}b \notin \mathbb{Q}$ and $f+g$ periodic and $c$ the smallest period of g, $\forall x\in \mathbb{R}$ we have,
$$
f(x+c)+g(x+c)=f(x)+g(x),
$$
What is better rewritten in the invariant form :
$$
f(x+c)-f(x)=g(x)-g(x+c)
$$
Denote $\gamma(x)$ the common value, then for $k,l$ integer we find
$$
\gamma(x + ka + lb) = f (x + ka + lb + c) - f (x + ka + lb)
$$
$$
= f (x + lb + c) - f (x + lb)
$$
$$
= \gamma(x + lb) = g (x + lb + c) -g (x + lb) = g (x + c) -g (x) = \gamma(x)
$$
Therefore, all real of $a\mathbb{Z}+b\mathbb{Z}$ is a period of $\gamma$
But $a\mathbb{Z}+b\mathbb{Z}$ is dense in $\mathbb{R}$ because $\frac{a}b \notin \mathbb{Q}$.
Therefore $\gamma$ is $\epsilon$-periodic fo all $\epsilon$.
As $\gamma$ is continuous, he is necessarily constant :
$$
\gamma=\gamma_0
$$
Furthermore,
$$
f(Id+c) = f + \gamma_0,
$$
Then for all real x we have,
$$
f(x+nc)=f(x)+n\gamma_0
$$
$$
\Longrightarrow \gamma_0=0
$$
because $f$ is continuous and periodic thus $f$ is bounded.
Therefore, $c$ is a common period of $f$ and $g$.
Then $c$ is in $a\mathbb{N^*}\bigcap b\mathbb{N^*}$, but he is empty because $\frac{a}b \notin \mathbb{Q}$. QED