5. (2003 Hunan Province Competition Question) Let the domain of the function $y=f(x)$ be $\mathbf{R}$, and when $x>1$, and for any real numbers $x, y \in \mathbf{R}$, $f(x+y)=f(x) f(y)$ holds. The sequence $\left\{a_{n}\right\}$ satisfies $a_{1}=f(0)$, and
$$
f\left(a_{n+1}\right)=\frac{1}{f\left(-2-a_{n}\right)}(n \in \mathbf{N}) .
$$
5. (1) Let $x=-1, y=0$ we get
$f(-1)=f(-1) f(0), f(0)-1$. Hence $a_{1}=f(0)=1$.
When $x>0$, $-x<0, f\left(x_{2}-x_{1}\right)<0$.
\end{aligned}
\end{array}
$$

Therefore, $f\left(x_{1}\right)>f\left(x_{2}\right)$, the function $y=f(x)$ is monotonically decreasing on $\mathbf{R}$.
From $f\left(a_{n+1}\right)=\frac{1}{f\left(-2-a_{n}\right)}$, we get
$$
\begin{array}{l}
f\left(a_{n+1}\right) f\left(-2-a_{n}\right)=1, \text{ hence } \\
f\left(a_{n+1}-a_{n}-2\right)=f(0), a_{n+1}-a_{n}-2=0 \\
a_{n+1}-a_{n}=2(n \in \mathbf{N}) .
\end{array}
$$

Therefore, $\left\{a_{n}\right\}$ is an arithmetic sequence with the first term 1 and common difference 2. Thus, $a_{n}=2 n-1, a_{2003}=4005$.
(2) From $\left(1+\frac{1}{a_{1}}\right)\left(1+\frac{1}{a_{2}}\right) \cdots\left(1+\frac{1}{a_{n}}\right) \geqslant k \sqrt{2 n+1}$ always holds, we know $k \leqslant \frac{\left(1+\frac{1}{a_{1}}\right)\left(1+\frac{1}{a_{2}}\right) \cdots\left(1+\frac{1}{a_{n}}\right)}{\sqrt{2 n+1}}$ always holds.
Let $F(n)=\frac{\left(1+\frac{1}{a_{1}}\right)\left(1+\frac{1}{a_{2}}\right) \cdots\left(1+\frac{1}{a_{n}}\right)}{\sqrt{2 n+1}}$, then $F(n)>0$,
and $F(n+1)=\frac{\left(1+\frac{1}{a_{1}}\right)\left(1+\frac{1}{a_{2}}\right) \cdots\left(1+\frac{1}{a_{n+1}}\right)}{\sqrt{2 n+3}}$
Also, $\frac{F(n+1)}{F(n)}=\frac{2(n+1)}{\sqrt{4(n+1)^{2}-1}}>1$, i.e., $F(n+1)>F(n)$, so $F(n)$ is a monotonically increasing function with respect to $n$, $F(n) \geqslant$ $F(1)=\frac{2}{3} \sqrt{3}$
Therefore, $k \leqslant \frac{2}{3} \sqrt{3}$, i.e., the maximum value of $k$ is $\frac{2}{3} \sqrt{3}$.