5. $\frac{1}{2}$.
$f(x)=\left|x^{2}-a\right|$ is an even function, so $M(a)$ is the maximum value of $f(x)$ in $[0,1]$. When $a \leqslant 0$, $f(x)=x^{2}-a$, then $M(a)=1-a$; When $a>0$, draw the graph of $f(x)$. If $\sqrt{2 a} \geqslant 1$, then $M(a)=a$; if $\sqrt{2 a} \leqslant 1$, then $M(a)=f(1)=1-a$. Therefore, $M(a)=\left\{\begin{array}{l}1-a, a \leqslant \frac{1}{2} \\ a, a>\frac{1}{2} .\end{array}\right.$
5. The maximum value $M(a)$ of the function $f(x)=\left|x^{2}-a\right|$ on the interval $[-1,1]$ has its minimum value equal to
$\qquad$ .