Simplify
\[\cos^2 x + \cos^2 \left( \frac{\pi}{3} + x \right) + \cos^2 \left( \frac{\pi}{3} -  x \right).\]
From the angle addition formula,
\[\cos \left( \frac{\pi}{3} + x \right) = \frac{1}{2} \cos x - \frac{\sqrt{3}}{2} \sin x\]and
\[\cos \left( \frac{\pi}{3} -  x \right) = \frac{1}{2} \cos x + \frac{\sqrt{3}}{2} \sin x.\]Therefore,
\begin{align*}
&\cos^2 x + \cos^2 \left( \frac{\pi}{3} + x \right) + \cos^2 \left( \frac{\pi}{3} -  x \right) \\
&= \cos^2 x + \left (\frac{1}{2} \cos x - \frac{\sqrt{3}}{2} \sin x \right)^2 + \left (\frac{1}{2} \cos x + \frac{\sqrt{3}}{2} \sin x \right)^2 \\
&= \cos^2 x + \frac{1}{4} \cos^2 x - \frac{\sqrt{3}}{2} \cos x \sin x + \frac{3}{4} \sin^2 x + \frac{1}{4} \cos^2 x + \frac{\sqrt{3}}{2} \cos x \sin x + \frac{3}{4} \sin^2 x \\
&= \frac{3}{2} \cos^2 x + \frac{3}{2} \sin^2 x \\
&= \boxed{\frac{3}{2}}.
\end{align*}