\(f\left(x\right)=e^{sinx}-sinx-1\)
\(\Rightarrow f'\left(x\right)=cosx.e^{sinx}-cosx=cosx\left(e^{sinx}-1\right)\)
\(f'\left(x\right)=0\Leftrightarrow\left[{}\begin{matrix}cosx=0\\sinx=0\end{matrix}\right.\) \(\Rightarrow\left[{}\begin{matrix}x=0\\x=\dfrac{\pi}{2}\\x=\pi\end{matrix}\right.\)
\(f\left(0\right)=0\) ; \(f\left(\dfrac{\pi}{2}\right)=e-2\) ; \(f\left(\pi\right)=0\)
\(\Rightarrow f\left(x\right)_{min}=0\) ; \(f\left(x\right)_{max}=e-2\)