8. Let $(a, b)$ be a pair of numbers satisfying the condition of the problem. Then the equality holds for any $x$, including $x=\pi$, and $x=2 \pi$. Substituting these values of $x$, we get the system $\left\{\begin{array}{c}-2 a+b^{2}=\operatorname{Cos}\left(\pi a+b^{2}\right)-1 \\ b^{2}=\operatorname{Cos}\left(2 \pi a+b^{2}\right)-1\end{array}\right.$ From the second equality, it follows that $b^{2} \leq 0$, i.e., $b=0$, and then $\operatorname{Cos} 2 \pi a=1 \Leftrightarrow a=n \in N \cup\{0\}$. From the first equality, we get $\operatorname{Cos} \pi a=1-2 a \Rightarrow-1 \leq 1-2 a \leq 1 \Leftrightarrow 0 \leq a=n \leq 1$. Therefore, the necessary condition of the problem is satisfied only by two pairs of numbers $a=0, b=0$ and $a=1, b=0$. Let's check that for these pairs the equality holds for all $x$. When $a=b=0$, we have $\operatorname{Cos} 0=1$, which is true. When $a=1$ and $b=0$, we get $\operatorname{Cos} x=\operatorname{Cos} x$, which is also true.
Answer: $(0 ; 0),(1 ; 0)$.