13. Let $a \in \mathbf{R}$, and the function $f(x)=a x^{2}+x-a(|x| \leqslant 1)$.
(1) If $|a| \leqslant 1$, prove: $|f(x)| \leqslant \frac{5}{4}$;
(2) Find the value of $a$ that makes the function $f(x)$ have a maximum value of $\frac{17}{8}$.
13. (1) $|f(x)|=\left|a\left(x^{2}-1\right)+x\right| \leqslant\left|a\left(x^{2}-1\right)\right|+|x| \leqslant\left|x^{2}-1\right|+|x|=1-|x|^{2}+|x|=$ $-\left(|x|-\frac{1}{2}\right)^{2}+\frac{5}{4} \leqslant \frac{5}{4}$.
(2) Clearly, $a \neq 0$
(i) If $a>0, f(-1)$ or $f(1)$ has the maximum value, which does not fit.
(ii) If $a<0$, then $-1<-\frac{1}{2 a}<1, f\left(-\frac{1}{2 a}\right)=\frac{17}{8}$, from which we can find $a=-2$.
In conclusion, $a=-2$.