5. Given that the derivative function $f^{\prime}(x)$ of $f(x)$ is continuous, and $f(0)=0, f^{\prime}(0)=a$. Let the point $Q(s, f(s))$ be the closest point on the curve $y=f(x)$ to $P(t, 0)$. Then $\lim _{t \rightarrow 0} \frac{s}{t}=$
5. $\frac{1}{1+a^{2}}$.

Let $y=P Q^{2}=(x-t)^{2}+f^{2}(x)$. Then $y^{\prime}=2(x-t)+2 f(x) f^{\prime}(x)$.
From the given information,
$$
2(s-t)+2 f(s) f^{\prime}(s)=0 \text {. }
$$

Then $\frac{s}{t}=1-\frac{f(s) f^{\prime}(s)}{t}=1-\frac{s}{t} \cdot \frac{f(s)}{s} f^{\prime}(s)$.
Let $\lim _{t \rightarrow 0} \frac{s}{t}=A$.
And $\lim _{s \rightarrow 0} \frac{f(s)}{s}=f^{\prime}(0)=a$, so
$$
\lim _{s \rightarrow 0} f^{\prime}(s)=a \text {. }
$$

Taking the limit on both sides of equation (1) gives
$$
\begin{array}{l}
A=1-a^{2} A \Rightarrow A=\frac{1}{1+a^{2}} \\
\Rightarrow \lim _{t \rightarrow 0} \frac{s}{t}=\frac{1}{1+a^{2}} .
\end{array}
$$