Example 5 Function
$$
y=\sqrt{\sin x}+\sqrt{\cos x}\left(0 \leqslant x \leqslant \frac{\pi}{2}\right)
$$

The range of the function is $\qquad$
(2001, Shanghai Jiao Tong University Independent Admission Examination)
Notice,
$$
\begin{array}{l}
y^{4}=(\sqrt{\sin x}+\sqrt{\cos x})^{4} \\
=[(\sqrt{\sin x}+\sqrt{\cos x})(\sqrt{\sin x}+\sqrt{\cos x})]^{2} \\
\geqslant(\sin x+\cos x)^{2} \\
\geqslant \sin ^{2} x+\cos ^{2} x=1\left(x=0 \text { or } \frac{\pi}{2} \text { when equality holds }\right), \\
y^{4}=(\sqrt{\sin x}+\sqrt{\cos x})^{4} \\
\leqslant(1+1)(1+1)(1+1)\left(\sin ^{2} x+\cos ^{2} x\right) \\
=8\left(x=\frac{\pi}{4} \text { when equality holds }\right) .
\end{array}
$$

Therefore, $1 \leqslant y \leqslant 8^{\frac{1}{4}}$.