Is a function periodic $f(x) = \cos (x) +\cos(x^2)$

Without using the derivative, the equation $f(x) = f(0)$ has only one solution. Indeed, if $\cos(x)+\cos(x^2)=2$ then $\cos(x) = 1 = \cos(x^2)$ so there exists $p,q \in \mathbb{Z}$ such that $x = 2p \pi$ and $x^2 = 2q \pi$, so $\pi = \frac{q}{2 p^2}$. But $\pi$ is not rational ; absurd.

This may be overkill, but at least the same reasoning can prove the following : given any $\beta$-periodic function $g$ with $\beta \in \mathbb{R} \backslash \mathbb{Q}$ and such that $g(x) \neq g(0)$ for $x \in ]0,\beta[$, the function $x \mapsto g(x)+g(x^2)$ is not periodic. For instance, this is also true if $g$ is the Weierstrass function (if $b\notin 2\mathbb{Z}$, with the definition used by wiki).


If $f(x)=\cos x+\cos(x^{2})$ is periodic, then so is $f'(x) = -\sin x -2x\sin (x^{2})$, which is impossible since $f'(x)$ is not bounded. (For $x_{n} = \sqrt{(2n+1/2)\pi}$ ($n>0$), we have $f'(x_{n})=-\sin x_{n}-2x_{n}\leq 1-2\sqrt{2n\pi}$ which tends to $-\infty$ as $n\to \infty$.)