\(y'=1-\sqrt{2}sinx=0\Leftrightarrow sinx=\frac{1}{\sqrt{2}}\Rightarrow x=\frac{\pi}{4}\)
\(y\left(0\right)=\sqrt{2}\) ; \(y\left(\frac{\pi}{4}\right)=\frac{\pi}{4}+1\) ; \(y\left(\frac{\pi}{2}\right)=\frac{\pi}{2}\)
\(\Rightarrow y_{max}=y\left(\frac{\pi}{4}\right)=\frac{\pi}{4}+1\)
\(y_{min}=y\left(0\right)=\sqrt{2}\)