9. Let $a_{1}, a_{2}, \ldots, a_{2019} \in[-1,1]$, and $a_{1}+a_{2}+\ldots+a_{2019}=0$, find the maximum and minimum values of $f=a_{1}^{3}+a_{2}^{3}+\ldots+a_{2019}^{3}$
9. Solution: Since $a_{i} \in[-1,1]$, we can set $a_{i}=\cos \theta_{i}, i=1,2, \ldots, 2019$.

By the triple angle formula $\cos 3 \theta=4 \cos ^{3} \theta-3 \cos \theta$, we have
$$
f=\sum_{i=1}^{2019} \frac{3 \cos \theta_{i}+\cos 3 \theta_{i}}{4}=\sum_{i=1}^{2019} \frac{\cos 3 \theta_{i}}{4} \leq \frac{2019}{4}
$$

Taking $a_{i}=\left\{\begin{array}{l}1, i \text { is a multiple of 3 } \\ -\frac{1}{2}, \text { otherwise }\end{array}, i=1,2, \ldots, 2019\right.$, we can see that $f$ can achieve its maximum value.