5. Let $a, b$ be real numbers, and the function $f(x)=a x+b$ satisfies: for any $x \in[0,1]$, we have $|f(x)| \leqslant 1$. Then the maximum value of $a b$ is $\qquad$ .
$$
\begin{array}{l}
\left\{\begin{array} { l } 
{ f ( 0 ) = b , } \\
{ f ( 1 ) = a + b }
\end{array} \Rightarrow \left\{\begin{array}{l}
a=f(1)-f(0), \\
b=f(0)
\end{array} \Rightarrow a b=f(0)[f(1)-f(0)]\right.\right. \\
=-f^{2}(0)+f(1) f(0)=-\left[f(0)-\frac{1}{2} f(1)\right]^{2}+\frac{1}{4} f^{2}(1) \leqslant \frac{1}{4} .
\end{array}
$$

When the equality holds, $b=\frac{1}{2}(a+b) \Rightarrow a=b= \pm \frac{1}{2}$ satisfies the condition, so the maximum value of $a b$ is $\frac{1}{4}$.