Example 5 Given that $x, y$ are real numbers, and $x^{2}+x y+$ $y^{2}-2=0$. Then the range of values for $x^{2}-x y+y^{2}$ is $\qquad$
(1996, Huanggang Region, Hubei Province Junior High School Mathematics Competition)
Solution: Let $x^{2}-x y+y^{2}=t$, then from the given conditions we have
$$
t=2-2 x y \text {, }
$$

i.e., $x y=\frac{2-t}{2}$;
$$
(x+y)^{2}=2+x y=2+\frac{2-t}{2}=\frac{6-t}{2} .
$$

Since $(x+y)^{2} \geqslant 0$,
$$
(x+y)^{2}-4 x y=(x-y)^{2} \geqslant 0 \text {. }
$$

In the above two equations, substitute $\frac{6-t}{2}$ and $\frac{2-t}{2}$ for $(x+y)^{2}$ and $x y$ respectively, we get
$$
\begin{array}{l}
\left\{\begin{array}{l}
\frac{6-t}{2} \geqslant 0, \\
\frac{6-t}{2}-4 \cdot \frac{2-t}{2} \geqslant 0
\end{array}\right. \\
=\left\{\begin{array}{l}
i-0 \leq 0, \\
3 t-2 \geqslant 0
\end{array}\right. \\
\Rightarrow \frac{2}{3} \leqslant t \leqslant 6 \text {. } \\
\text { Therefore, } \frac{2}{3} \leqslant x^{2}-x y+y^{2} \leqslant 6 \text {. } \\
\end{array}
$$