9. (14 points) Let the function $f(x)$ be defined on the closed interval
$[0,1]$, satisfying $f(0)=0, f(1)=1$, and for any $x, y \in[0,1](x \leqslant y)$, we have
$$
f\left(\frac{x+y}{2}\right)=\left(1-a^{2}\right) f(x)+a^{2} f(y),
$$

where the constant $a$ satisfies $0<a<1$. Find the value of $a$.