If the solve the problem
Question:

$f(x)=\cos x, 0<x<\pi$

Solution:

Given : $f(x)=\cos x$

$\Rightarrow f^{\prime}(x)=-\sin x$

For a local maximum or a local minimum, we must have

$f^{\prime}(x)=0$

$\Rightarrow-\sin x=0$

$\Rightarrow \sin x=0$

$\Rightarrow x=0$ or $\pi$

Since $0<x<\pi$, none is in the interval $(0, \pi)$.