Example 7 Let $x, y$ be real numbers, and $x^{2} + xy + y^{2} = 3$. Find the maximum and minimum values of $x^{2} - xy + y^{2}$.
(1994, Huanggang City, Hubei Province Junior High School Mathematics Competition)
Solution: Let $x^{2}-x y+y^{2}=m$.
Also, $x^{2}+x y+y^{2}=3$,
Solving, we get $x+y= \pm \sqrt{\frac{9-m}{2}}, x y=\frac{3-m}{2}$.
Then $x, y$ are the two real roots of the equation $t^{2} \pm \sqrt{\frac{9-m}{2}} t+\frac{3-m}{2}=0$. Therefore,
$$
\Delta=\left( \pm \sqrt{\frac{9-m}{2}}\right)^{2}-4 \cdot \frac{3-m}{2} \geqslant 0 .
$$

Solving, we get $m \geqslant 1$.
Also, $\frac{9-m}{2} \geqslant 0$, i.e., $m \leqslant 9$, so $1 \leqslant m \leqslant 9$.
Therefore, the maximum value is 9, and the minimum value is 1.