Here is a counterexample. Let $a, b, c \in \mathbb{R}$ be linearly independent over $\mathbb{Q}$. Let $\text{span}(x, y, z, ...)$ be the $\mathbb{Q}$-vector space in $\mathbb{R}$ spanned by $x, y, z, ...$. Let $AB = \text{span}(a, b), BC = \text{span}(b, c), AC = \text{span}(a, c)$. And for a subset $S$ of $\mathbb{R}$, let $\chi_S$ denote the characteristic function of $S$. Now define
$\displaystyle f(x) = \chi_{AB} - 2 \chi_{BC}$
and
$\displaystyle g(x) = 3 \chi_{AC} + 2 \chi_{BC}.$
Then $f$ has period set $\text{span}(b)$, $g$ has period set $\text{span}(c)$, and $f + g$ has period set $\text{span}(a)$. (I am not sure if the coefficients are necessary; they're just precautions.)
Are you still interested in the continuous case?
(Old answer below. I slightly misunderstood the question when I wrote this.)
Here is a simpler example. I claim that the function $h(x) = \sin x + \sin \pi x$ cannot possibly be periodic. Why? Suppose an equation of the form
$\sin x + \sin \pi x = \sin (x+T) + \sin \pi (x+T)$
held for all $x$ and some $T > 0$. Take the second derivative of both sides with respect to $x$ to get
$\sin x + \pi^2 \sin \pi x = \sin (x+T) + \pi^2 \sin \pi(x+T).$
This implies that $\sin x = \sin (x+T)$ and that $\sin \pi x = \sin \pi(x+T)$, which is impossible.
(Or is the question whether the sum can be periodic?)