Solution (source code)

= Solution

The <extreme value theorem> guarantees extrema on the closed <interval>. Compare its endpoints and the <stationary points> $0,\pm\sqrt{10/3}$:
$$
f(\pm3)=330,\qquad f(0)=6,\qquad
f\!\left(\pm\sqrt{10/3}\right)=-\frac{338}{27}.
$$
Thus
$$
\boxed{\operatorname*{arg\,max}_{[-3,3]}f=\{-3,3\},\qquad
\operatorname*{arg\,min}_{[-3,3]}f=
\left\{-\sqrt{\frac{10}{3}},\sqrt{\frac{10}{3}}\right\}.}
$$
The two-point answer in each case also follows from the <even function> symmetry.