Example 6 Find the maximum and minimum values of the function $y=\frac{x^{2}-2 x-3}{2 x^{2}+2 x+1}$.
Solve by eliminating the denominator, and organize into an equation about $x$: $(2 y-1) x^{2}+2(y+1) x+(y+3)=0$. When $x=-\frac{7}{6}$, $y=\frac{1}{2}$; when $y \neq \frac{1}{2}$, it is clear that the above quadratic equation has real roots. Then
$$
\Delta=[2(y+1)]^{2}-4(2 y-1)(y+3) \geqslant 0, y \in[-4,1]
$$

and when $x=-\frac{1}{3}$, $y=-4$; when $x=-2$, $y=1$, so $y_{\text {min }}=-4, y_{\text {max }}=1$