Alternative approach:
At 1st let's divide the range [0,π] into 2 ranges : [0,π/2] and [π/2,π]
Now let G(x) = x - cosx, so
G(0) = 0 - cos0 = -1 and. G(π/2) = π/2 - cosπ/2 = π/2
Now as G(0) and G(π/2) are of opposite sign and also G(x) is continuous in [0,π/2] and differentiable in (0,π/2) so we can say there must be atleast one x in (0,π/2) such that G(x) = 0. (Intermediate value theorem)
Now G'(x) = 1 + sinx and 1+sinx > 0 for x in [0,π/2]. So G(x) is a positive function in the range [0,π/2] and hence we can conclude that there exist exactly one x in [0,π/2] such that G(x) = 0 (or x-cosx = 0).
Now let's see the range [π/2,π]. In this range G(x) can never be 0 as x is positive and cosx is negative in this range and hence x = cosx is not possible in this range.
So we can conclude that x = cosx has exactly one solution in range [0,π/2] and exactly 0 solution in range [π/2,π] and therefore option B is the answer.
Please correct me if I am wrong.