4. Let the function $y=f(x)$ satisfy for all $x \in \mathbf{R}$, $y=f(x) \geqslant 0$, and $f(x+1)=\sqrt{9-f^{2}(x)}$. It is known that when $x \in[0,1)$,
$$
f(x)=\left\{\begin{array}{ll}
2^{x}, & 0 \leqslant x \leqslant \frac{1}{2} ; \\
\lg (x+31), & \frac{1}{2} \leqslant x<1 .
\end{array}\right.
$$

Then $f(\sqrt{1000})=$ $\qquad$
4. $\frac{3 \sqrt{3}}{2}$.

From the given information, we have
$$
f^{2}(x+2)=9-f^{2}(x+1)=f^{2}(x) \text {. }
$$

Also, $y=f(x) \geqslant 0$, so $f(x+2)=f(x)$. Therefore, $y=f(x)$ is a periodic function with a period of 2.
Since $10 \sqrt{10}-31 \in\left(\frac{1}{2}, 1\right)$, we have
$$
f(10 \sqrt{10}-31)=\lg 10 \sqrt{10}=\frac{3}{2} \text {. }
$$

Thus, $f(\sqrt{1000})=f(10 \sqrt{10}-32)$
$$
=\sqrt{9-f^{2}(10 \sqrt{10}-31)}=\frac{3 \sqrt{3}}{2} .
$$