3. If the two real roots of the equation $x^{2}-m x+n+1=0$ are both positive integers, then $m^{2}+n^{2}$ is ( ).
(A) Composite number
(B) Prime number
(C) Perfect square
(D) Even number
3. A.

Let the two positive integer roots of the equation be $x_{1}$ and $x_{2}$. Then
$$
\begin{array}{l}
x_{1}+x_{2}=m, \\
x_{1} x_{2}=n+1 .
\end{array}
$$

Therefore, $m^{2}+n^{2}=\left(x_{1}+x_{2}\right)^{2}+\left(x_{1} x_{2}-1\right)^{2}$
$$
=\left(x_{1}^{2}+1\right)\left(x_{2}^{2}+1\right) \text {. }
$$

Since $x_{1}^{2}+1>1, x_{2}^{2}+1>1$, it follows that $m^{2}+n^{2}$ must be a composite number.