The sum of two periodic functions need not be a periodic function Let $f(x)=x-[x]$ and $g(x)=\tan x$.

How could we see that $f(x)-g(x)$ is not a periodic function?

This will show that the sum of two periodic functions need not be a periodic function.
I hope the answer has enough details so that I could catch you.
 A: First, notice the range of g is not $\mathbb{R}$ but $\mathbb{R} \cup \{ \infty \}$.
Second, $g$ and hence $f - g$ take the value $\infty$ $\color{red}{\text{at and only at}}$ $x = \pm \frac{\pi}{2}, \pm \frac{3\pi}{2}, \pm\frac{5\pi}{2}, \ldots$. This means if $f - g$ is a periodic function, then its period must have the form $n\pi$ where $n \in \mathbb{Z}_{+}$. If $n\pi$ is a period, we will have:
$$f(n\pi) - g(n\pi) = f(0) - g(0)\quad\implies\quad n\pi - \lfloor n\pi\rfloor = 0
\quad\implies\quad \pi = \frac{\lfloor n\pi\rfloor}{n} \in \mathbb{Q}$$
This contradicts with the known fact that $\pi$ is an irrational number.
A: For example, $sin(x) + sin(\sqrt{2} x)$ is not periodic
A: As user84559 said above, the period T of the difference must be an integer multiple of $f(x)$ and $g(x)$. Now the period of $f(x)$ is $1$, and the period of $f(x)$ is $pi$. So the period could be integer multiples of each period, such as $1, 2, 3, ...$ or $pi, 2pi, 3pi, ... $However, there are no common multiples of $1$ and pi. In other words any of $1, 2, 3,...$ will never equal $pi, 2pi, 3pi...$
