You are on the right track. Start with
$$\cos 3x = \cos x$$
Substituting, $\cos 3x = 4 \cos^3x - 3\cos x$, you get
$$4\cos^3x-3\cos x = \cos x$$
Thus, $$\cos^3x-\cos x = 0$$
We can write this as $$\cos x(\cos^2x-1) = 0$$
By factoring the difference of two squares we get,
$$\cos x(\cos x+1)(\cos x−1)=0$$
As we expected this equation has 3 factors and hence three solutions
Set each factor equal to 0 and solve using unit circle, here $n$ is a natural number.
$\cos x = 0$ which is satisfied for values, $x={±\frac{(2n-1)π}{2}}$
$\cos x+1=0$, thus $\cos x=−1$ which is satisfied for values, $x=nπ$
$\cos x−1=0$, thus $\cos x=1$ which is satisfied for values $x=0,2nπ$