Let's find all solutions to the equation

$$
\cos ^{2} x-2 \cos x \cos y \cos (x+y)+\cos ^{2}(x+y)=a
$$

What is the condition for solvability?
We simplify the expression on the left side of the equation. We complete the square for $-2 \cos x \cos y \cos (x+y) + \cos^2 (x+y)$:

$$
\begin{aligned}
& \cos^2 x - 2 \cos x \cos y \cos (x+y) + \cos^2 (x+y) = \\
= & \cos^2 x + [\cos x \cos y - \cos (x+y)]^2 - \cos^2 x \cos^2 y
\end{aligned}
$$

Expanding $\cos (x+y)$, we get:

$$
\begin{gathered}
\cos^2 x + [\cos x \cos y - \cos x \cos y + \sin x \sin y]^2 - \cos^2 x \cos^2 y = \\
= \cos^2 x + \sin^2 x \sin^2 y - \cos^2 x \cos^2 y = \cos^2 x (1 - \cos^2 y) + \\
+ \sin^2 x \sin^2 y = \sin^2 y (\cos^2 x + \sin^2 x) = \sin^2 y
\end{gathered}
$$

Thus, our equation becomes

$$
\sin^2 y = a
$$

Since $0 \leq |\sin y| \leq 1$ and the square of any number with an absolute value not greater than 1 is also not greater than 1, the solvability condition is that $0 \leq a \leq 1$. If $a$ is chosen in this way, the value of $y$ is determined, but the value of $x$ can be arbitrary.