Answer
$$\eqalign{
& {\text{Domain}}:\left[ {0,2\pi } \right] \cr
} $$
Work Step by Step
$$\eqalign{
& f\left( x \right) = - x + 2\cos x,{\text{ }}0 \leqslant x \leqslant 2\pi \cr
& {\text{The domain of the function is }}D:\left[ {0,2\pi } \right] \cr
& \cr
& {\text{*Differentiating }} \cr
& f'\left( x \right) = \frac{d}{{dx}}\left[ { - x + 2\cos x} \right] \cr
& f'\left( x \right) = - 1 - 2\sin x \cr
& {\text{Set }}f'\left( x \right) = 0 \cr
& - 1 - 2\sin x = 0 \cr
& \sin x = - \frac{1}{2} \cr
& {\text{On the interval }}\left[ {0,2\pi } \right]{\text{ }}\sin x = - \frac{1}{2}{\text{ at: }}x = \frac{{7\pi }}{6},{\text{ }}x = \frac{{11\pi }}{6} \cr
& \cr
& {\text{*Find the second derivative}} \cr
& f''\left( x \right) = \frac{d}{{dx}}\left[ { - 1 - 2\sin x} \right] \cr
& f''\left( x \right) = - 2\cos x \cr
& {\text{Evaluate }}f''\left( x \right){\text{ at the critical points }}x = \frac{{7\pi }}{6},{\text{ }}x = \frac{{11\pi }}{6} \cr
& f''\left( {\frac{{7\pi }}{6}} \right) = \sqrt 3 > 0,{\text{ relative minimum}} \cr
& f\left( {\frac{{7\pi }}{6}} \right) = - \frac{{7\pi }}{6} - \sqrt 3 {\text{,}} \cr
& \to {\text{Relative minimum at }}\left( {\frac{{7\pi }}{6}, - \frac{{7\pi }}{6} - \sqrt 3 } \right) \cr
& f''\left( {\frac{{11\pi }}{6}} \right) = - \sqrt 3 < 0,{\text{ relative maximum}} \cr
& f\left( {\frac{{11\pi }}{6}} \right) = - \frac{{11\pi }}{6} + \sqrt 3 {\text{,}} \cr
& \to {\text{Relative maximum at}}\left( { - \frac{{11\pi }}{6}, - \frac{{11\pi }}{6} + \sqrt 3 } \right) \cr
& \cr
& {\text{Set }}f''\left( x \right) = 0 \cr
& - 2\cos x = 0 \cr
& \cos x = 0 \cr
& {\text{On the interval }}\left[ {0,2\pi } \right]{\text{ }}\cos x = 0{\text{ at: }}x = \frac{\pi }{2},{\text{ }}x = \frac{{3\pi }}{2} \cr
& f\left( {\frac{\pi }{2}} \right) = - \frac{\pi }{2} \cr
& f\left( {\frac{{3\pi }}{2}} \right) = - \frac{{3\pi }}{2} \cr
& {\text{The inflection points are:}} \cr
& \left( {\frac{\pi }{2}, - \frac{\pi }{2}} \right),\left( {\frac{{3\pi }}{2}, - \frac{{3\pi }}{2}} \right) \cr
& \cr
& {\text{*There are no vertical asymptotes because the denominator}} \cr
& {\text{is never 0}}{\text{.}} \cr
& *{\text{There are no horizontal asymptotes}} \cr
& \cr
&} $$