Example 5. Find the range of $y=\frac{1}{x^{2}+x+1}$.
Solve: The original equation can be transformed into $y x^{2}+y x+y-1=0$.
$$
\begin{array}{l}
\because x \in R, \\
\therefore y^{2}-4 \times y \times(y-1) \geqslant 0,
\end{array}
$$

which is $3 y^{2}-4 y \leqslant 0$.
Since $y_{1}=0, y_{2}=\frac{4}{3}$ are the two roots of $3 y^{2}-4 y=0$, and $a=3>0$,
$\therefore$ the range of the function is $0 \leqslant y \leqslant \frac{4}{3}$.
Note: If $y=f(x)$ can be transformed into a quadratic equation in terms of $u=u(x)$: $F(u, y)=0$ (considering $y$ as a constant), and the range of $u(x)$ is a proper subset of $R$, then using the discriminant to find the range of $y$ often leads to problems.

For example, to find the range of the function $y=\sqrt{\frac{1}{4}-\sin ^{2} x}+|\sin x|$.
Incorrect solution:
The original equation can be transformed into:
$$
y-|\sin x|=\sqrt{\frac{1}{4}-\sin ^{2} x},
$$

squaring both sides, we get: $y^{2}-2 y|\sin x|+|\sin x|^{2}$
$$
=\frac{1}{4}-|\sin x|^{2} \text {. }
$$

Rearranging, we get $8|\sin x|^{2}-8 y|\sin x|$ $+4 y^{2}-1=0$
$\because|\sin x|$ is a real number,
$$
\therefore(8 y)^{2}-4 \cdot 8 \cdot\left(4 y^{2}-1\right) \geqslant 0 \text {, }
$$

which is $y^{2} \leqslant \frac{1}{2}$.
$$
\begin{array}{l}
\therefore-\frac{\sqrt{2}}{2} \leqslant y \leqslant \frac{\sqrt{2}}{2} . \\
\text { Also } \because y=\sqrt{\frac{1}{4}-\sin ^{2} x}+|\sin x| \geqslant 0,
\end{array}
$$
$\therefore$ the range of the function is $0 \leqslant y \leqslant \frac{\sqrt{2}}{2}$.