How can one prove that $$\cos\left(\frac{\pi}{2} t \right)+\cos\left(t \right)$$ is not periodic?
This question is motivated by the harmonic spectral representation of time series. Indeed, it is easy to show that a path of a time series given by $$ \cos(\lambda_1 t) + \cos(\lambda_2 t)$$ is periodic if $\frac{\lambda_1}{\lambda_2} \in \mathbb{Q}$. In the above example this is not the case since $\frac{\lambda_1}{\lambda_2} = \pi/2.$
So the case above could serve as an example for the statement: if $\frac{\lambda_1}{\lambda_2} \not\in \mathbb{Q}$ then the path of a harmonic time series is in general not periodic.
The general case solves similarly.
Suppose that $ f(t) = \cos(\lambda_1 t) + \cos(\lambda_2 t)$ is periodic = $f(t + T)$
Then $f(0) = \cos(0) + \cos(0) = 2 = \cos(\lambda_1 T) + \cos(\lambda_2 T)$
So, $\lambda_1 T = 2\pi n$ and $\lambda_2 T = 2\pi m$ for integers n and m
Therefore $\frac{\lambda_1}{\lambda_2} = n/m$ i.e. $\frac{\lambda_1}{\lambda_2} \in \mathbb{Q}$
(assuming $\lambda_2, T$ are not zero).
A more general case is $ f(t) = c_1\cos(\lambda_1 t) + c_2\cos(\lambda_2 t)$
Assume firstly that $c_1$ and $c_2$ are the same sign. Then similar to the above $f(0) = c_1 \cos(0) + c_2 \cos(0) = c_1 + c_2 = c_1 \cos(\lambda_1 T) + c_2 \cos(\lambda_2 T)$ Since $c_1$ and $c_2$ are the same sign this still requries that $\lambda_1 T = 2\pi n$ and $\lambda_2 T = 2\pi m$ for integers n and m and the result follows.
If they are different signs, then my answer posted earlier was wrong,
And, an even more general case is $ f(t) = c_1\cos(\lambda_1 t +\alpha_1) + c_2\cos(\lambda_2 t + \alpha_2)$
Here, use the expansion of $\cos (a + b) = \cos(a)\cos(b) + \sin(a) \sin(b)$. The function $f$ is now of the form $ f(t) = d_1\cos(\lambda_1 t) + d_2\cos(\lambda_2 t) + d_3\sin(\lambda_1 t) + d_4\sin(\lambda_2 t) $ .
My earlier conclusion of this part of the proof was wrong, so this is part of the question is still open.