2. “Function $f(x)$ is monotonic on $[a, b]$” is “Function $f(x)$ has a maximum value and a minimum value on $[a, b]$” ( ).
(A) a sufficient condition but not a necessary condition
(B) a necessary condition but not a sufficient condition
(C) a sufficient and necessary condition
(D) neither a sufficient condition nor a necessary condition
2. A.

If $f(x)$ is monotonic on $[a, b]$, then $f(a)$ and $f(b)$ are one the maximum value and the other the minimum value. Therefore, it is a sufficient condition;
$\sin x$ on $[0, \pi]$ has a maximum value of 1 and a minimum value of 0, but it is not monotonic, hence it is not a necessary condition.