4. Given the function
$$
f(x)=a x+b, \quad g(x)=\left\{\begin{array}{ll}
f(x), & 0 \leqslant x \leqslant a, \\
f(f(x)), & x>a .
\end{array}\right.
$$

If for any positive number $a$, the function $g(x)$ is strictly increasing on $[0,+\infty)$, then the minimum value of the constant $b$ is
(Liu Kaifeng)
4. $\frac{1}{4}$.

Given $f(x)=a x+b, f(f(x))=a^{2} x+a b+b$ are both increasing functions, we know that the function $g(x)$ is a strictly increasing function on $[0,+\infty)$ if and only if $f(f(a)) \geqslant f(a)$, which gives us
$$
b \geqslant a-a^{2}=-\left(a-\frac{1}{2}\right)^{2}+\frac{1}{4},
$$

Thus, the minimum value of the constant $b$ is $\frac{1}{4}$.