I tried to use Weierstrass M-test for checking if $$\sum_{k=2}^{\infty}\left(\cos\frac{x}{k}-\cos\frac{x}{k-1}\right)$$ converges uniformly on $(-\infty, \infty)$ and I got $\left|\cos\frac{x}{k}-\cos\frac{x}{k-1}\right|\leq\left|\cos\frac{x}{k}\right|+\left|\cos\frac{x}{k-1}\right|\leq1+1=2$,
$\sum_{k=2}^{\infty}2$ diverges $\Rightarrow \sum_{k=2}^{\infty}\left(\cos\frac{x}{k}-\cos\frac{x}{k-1}\right)$ doesn't converge uniformly on $(-\infty, \infty)$.
Is this correct?
Hint: since the series is telescoping, we can find an expression for the partial sums relatively easily
$$\sum_{k=2}^n \cos\left(\frac{x}{k}\right) - cos\left(\frac{x}{k-1}\right) = cos\left(\frac{x}{n}\right) - \cos x \to 1 - \cos x$$
With the formula and limit in hand, can you take it from here?