13. Given $\frac{1}{3} \leqslant a \leqslant 1$. If $f(x)=a x^{2}-2 x+1$ has a maximum value $M(a)$ and a minimum value $N(a)$ on $[1,3]$, let $g(a)=M(a)-N(a)$.
(1) Find the function expression for $g(a)$;
(2) Prove that $g(a) \geqslant \frac{1}{2}$ always holds.
(1) Notice that
$$
f(x)=a\left(x-\frac{1}{a}\right)^{2}+\left(1-\frac{1}{a}\right) \text {. }
$$

Then $N(a)=f\left(\frac{1}{a}\right)=1-\frac{1}{a}$.
When $1 \leqslant \frac{1}{a} \leqslant 2$, i.e., $\frac{1}{2} \leqslant a \leqslant 1$,
$$
M(a)=f(3)=9 a-5 \text {. }
$$

Thus, $g(a)=9 a-6+\frac{1}{a}$.
When $2 \leqslant \frac{1}{a} \leqslant 3$, i.e., $\frac{1}{3} \leqslant a \leqslant \frac{1}{2}$,
$$
M(a)=f(1)=a-1 \text {. }
$$

Thus, $g(a)=a-2+\frac{1}{a}$.
Therefore, $g(a)=\left\{\begin{array}{ll}a-2+\frac{1}{a}, & a \in\left[\frac{1}{3}, \frac{1}{2}\right] ; \\ 9 a-6+\frac{1}{a}, & a \in\left[\frac{1}{2}, 1\right] .\end{array}\right.$
(2) When $\frac{1}{3} \leqslant a_{1}0 .
\end{array}
$$

So, $g(a)$ is monotonically decreasing on $\left[\frac{1}{3}, \frac{1}{2}\right]$.
When $\frac{1}{2} \leqslant a_{1}<a_{2} \leqslant 1$,
$$
\begin{array}{l}
g\left(a_{1}\right)-g\left(a_{2}\right) \\
=\left(9 a_{1}-6+\frac{1}{a_{1}}\right)-\left(9 a_{2}-6+\frac{1}{a_{2}}\right) \\
=\left(a_{1}-a_{2}\right)\left(9-\frac{1}{a_{1} a_{2}}\right)<0 .
\end{array}
$$

So, $g(a)$ is monotonically increasing on $\left[\frac{1}{2}, 1\right]$.
Hence, $g\left(\frac{1}{2}\right)$ is the minimum value, i.e., $g(a) \geqslant \frac{1}{2}$.