5. Let $a, b$ be integers greater than 1,
$$
m=\frac{a^{2}-1}{b+1}, n=\frac{b^{2}-1}{a+1} \text {. }
$$

If $m+n$ is an integer, then the integer(s) among $m, n$ is(are) ).
(A) $m, n$
(B) $m$
(C) $n$
(D) none
5. A.

Since $q=m n=(a-1)(b-1)$ is an integer, and $p=m+n$ is an integer, therefore, $m$ and $n$ are the two rational roots of the equation $x^{2}-p x+q=0$.
Thus, $\Delta=p^{2}-4 q$ is a perfect square.
Solving the equation gives $m, n=\frac{p \pm \sqrt{p^{2}-4 q}}{2}$.
Since $p^{2}-4 q$ has the same parity as $p$, the numerator in the root expression is even.
Hence, $m$ and $n$ are both integers.