We know that x-cos(x) is continous. Since for x=0 =>0-cos(0) = -1 < 0 and for x=pi/2 => pi/2-cos(pi/2) = pi/2 > 0 it follows from the intermediate value theorem (Intermediate value theorem - Wikipedia, the free encyclopedia) that x-cos(x) has a root.