5. Let the function $y=f(x)$ satisfy: for all $x \in \mathbf{R}$,
$$
\begin{array}{l}
f(x) \geqslant 0 \text {, and } f(x+1)=\sqrt{9-f^{2}(x)} \text {. } \\
\text { When } x \in[0,1) \text {, }
\end{array}
$$
5.D.

From the given, we have
$$
\begin{array}{l}
f^{2}(x+1)=9-f^{2}(x), \\
f^{2}(x+2)=9-f^{2}(x+1) .
\end{array}
$$

Therefore, $f^{2}(x+2)=f^{2}(x)$.
Since $f(x) \geqslant 0$, then $f(x+2)=f(x)$.
Thus, $f(x)$ is a periodic function with a period of 2.
Given $31\frac{1}{2}$, then
$$
f(10 \sqrt{10}-31)=\lg 10 \sqrt{10}=\frac{3}{2} \text {. }
$$

Substituting into equation (1) gives
$$
\begin{array}{l}
f(10 \sqrt{10}-32) \\
=\sqrt{9-f^{2}(10 \sqrt{10}-31)}=\frac{3 \sqrt{3}}{2} .
\end{array}
$$

Therefore, $f(\sqrt{1000})=\frac{3 \sqrt{3}}{2}$.