Since the period of $\cos 2x$ is $\pi$, you only need to prove there are no solutions in the domain $(-\frac{\pi}{2}, 0)$.
Note that the minimum value of $\cos 2x$ is $-1$. So it is sufficient to to look for solutions where $-1 < \tan x \Rightarrow -\frac{\pi}{4} < x$. But at $x = -\frac{\pi}{4}$, $\cos 2x$ is $\cos \left( -\frac{\pi}{2} \right) = 0$. Since $\cos x$ and $\tan x$ is monotone increasing in the domain, $0 < \cos x < 1$, and $-1 < \tan x < 0$. Hence there are no roots in this domain.
There is a solution in the domain $[0, \frac{\pi}{2}]$ as the range of $\tan x$ is $[0, \infty]$, so it must intersect $\cos 2x$ which has a range of $[0, 1]$ by the Intermediate Value Theorem. Therefore, there is a solution once per period $\pi$. Since $[-\pi, \pi]$ contains two periods, there are hence two solutions in $[-\pi, \pi]$.