Example 2 (2001 National College Entrance Examination Tianjin Paper) The function $y=1+3 x-x^{3}$ has ( ).
A. a minimum value of -1 and a maximum value of 1
B. a minimum value of -2 and a maximum value of 3
C. a minimum value of -2 and a maximum value of 2
D. a minimum value of -1 and a maximum value of 3
Solution: Choose D. Reason: Find the derivative of $f(x)$, identify the critical points, solve the equation $f^{\prime}(x)=0$, and determine the function's extremum based on the sign of $f^{\prime}(x)$ near the critical points.
Let $y^{\prime}=3-3 x^{2}=0$, then $x= \pm 1$.
When $x< -1$, $y^{\prime}>0$; when $-1<x<1$, $y^{\prime}>0$; when $x>1$, $y^{\prime}<0$.
Therefore, when $x=-1$, the function has a local minimum: $f(-1)=1-3-(-1)^{3}=-1$;

When $x=1$, the function has a local maximum: $f(1)=1+3-1^{3}=3$.