Example 2. Find the maximum and minimum values of the function $y=\frac{x^{2}+x-1}{x^{2}+x+1}$.
Misunderstanding: The original equation is transformed into $(y-1) x^{2}+(y-1) x+y+1=0, \because x \in R, \therefore \Delta=(y-1)^{2}-4(y-1)(y+1) \geqslant 0$, which means $-\frac{5}{3} \leqslant y \leqslant 1$, thus $y_{min}=-\frac{5}{3}, y_{max}=1$.

Analysis: In fact, when $y=1$, it implies $x^{2}+x-1=x^{2}+x+1 \Rightarrow-1=1$, which is a contradiction, hence $y \neq 1$. When using the discriminant $\left(b^{2}-4 a c \geqslant 0\right)$ to find the extremum, it is necessary to note that the essential condition for the equation $\mathrm{ax}^{2}+\mathrm{bx}+\mathrm{c}=0$ to be a quadratic equation in $\mathrm{x}$ is $a \neq 0$. In the above solution, before using $\Delta \geqslant 0$, it should be noted: (1) When $y \neq 1$, $\because x \in R$, $\therefore \Delta \geqslant 0 \Leftrightarrow-\frac{5}{3} \leqslant \mathrm{y}<1$; (2) When $y=1$, there is no value for $\mathrm{x}$, $\therefore \mathrm{y} \neq 1$. Therefore, the minimum value of the function $\mathrm{y}_{\mathrm{min}}=-\frac{5}{3}$.

In general, for the function $y=\frac{2_{1} x^{2}+b_{1} x+c_{1}}{a_{2} x^{2}+b_{2} x+c_{2}}$ $\left(-\frac{a_{1}}{a_{2}},-\frac{b_{1}}{b_{2}}, \frac{c_{1}}{c_{2}}=\right.$ values not all equal $)$, the set of values of the range is $A=\{y$
$$
\begin{array}{l}
\left\lvert\, \begin{array}{l}
a_{2} y-a_{1} \neq 0 \\
\left(b_{2} y-b_{1}\right)^{2}-4\left(a_{2} y-a_{1}\right)\left(c_{2} y-c_{1}\right) \geqslant 0
\end{array}\right. \\
U\left\{\begin{array}{l|l}
\mathrm{y} & \begin{array}{l}
a_{2} \mathrm{y}-a_{1}=0 \\
b_{2} y-b_{1} \neq 0
\end{array}
\end{array}\right\} . \\
\end{array}
$$