ans is B.
if you consider $x=0$ then $\cos x=1$
now if $x=\frac{\pi}{4} = 0.785$ then $\cos x=0.7071$
for some $x$ value $x=\cos x$
after this x is increasing and cosx is decreasing. so we can say exactly one solution.
EDIT-
It is very easy to show that the equation $x=\cos x $ has a unique solution. For example take $f(x) = x - \cos x$ and notice that $f'(x) = 1+\sin x \ge 0$ (equality holding in isolated points) so $f(x)$ is strictly increasing and hence the equation can have at most one solution.
At $x=0$, $f(x)$ is $\lt 0$ and at $x=\frac{\pi}{2}$, $f(x)$ is $\gt 0$, and function is continious (difference of two continuous functions is continuous). Therefore there is solution in $x \in \left [ 0,\frac{\pi}{2} \right ]$, hence there is a solution in $[0. \pi]$