Given a non constant periodic function with period $T$, say $f(x)$. Also given that $f(x)$ can be written as a linear combination of 2 independent functions as $$f(x) = a \, g(x) + b \, h(x),$$ where $a$ and $b$ are real constants.
Then my question is that does this imply that $g$ and $h$ are also periodic functions with period $T$ (not necessarily fundamental)??
Intuitively it seems true. But not sure how.
Consider something like
$$g(x)= \begin{cases} \sin x\text{,}&\text{if $x\notin\Bbb Q$,}\\ 0\text{,}&\text{if otherwise.} \end{cases} \quad\text{and}\quad h(x)= \begin{cases} \sin x\text{,}&\text{if $x\in\Bbb Q$,}\\ 0\text{,}&\text{if otherwise.} \end{cases} $$