Consider the function:
$$f(x)=4\cos^4\left(\frac{x-\pi}{4\pi^2}\right)-2\cos\left(\frac{x-\pi}{2\pi^2}\right)$$
One could immediately say that the period of this function is $\boxed{8\pi^3}$ which is the LCM of the period two individual functions. However the actual period of this function is $\boxed{2\pi^3}$ which can be verified by simplifying the function to
$$f(x)=\frac12\cos\left(\frac{x}{\pi^2}-\frac1\pi\right) + \frac32$$
How can I verify that the period I found naively is actually the shortest possible period considering the fact that one cannot always foresee such "nice" simplifications?
I don't think that there is a much better way than resorting to the definition and solving
$$f(t+T)=f(t)$$ for $T$ and keeping the smallest positive solution. Anyway, if $f$ is a combination of functions of known periods, the period will divide the $LCM$.
To illustrate, consider the functions $$16\cos^5x-20\cos^3 x+5\cos x$$
and
$$16\cos^5x-21\cos^3 x+5\cos x$$
which have periods $\dfrac{2\pi}5$ and $2\pi$ respectively.