5. On the hypotenuse $AB$ of the isosceles right $\triangle ABC$, take two points $M$ and $N$ such that $\angle MCN=45^{\circ}$. Let $AM=m, MN=x$, and $BN=n$. The shape of the triangle with side lengths $x, m, n$ is ( ).
(A) Acute triangle
(B) Right triangle
(C) Obtuse triangle
(D) Varies with $x, m, n$
5.(B).

As shown in Figure 4.
Construct $C D \perp C M$, and
$C D = C M$, connect
$N D$ and $B D$. It is easy to prove
$\triangle C A M \cong \triangle C B D$.
Therefore, $\angle C B D = \angle A = 45^{\circ}, A M = B D = m$.
Since $\angle M C N = 45^{\circ}$,
we have $\angle N C D = \angle M C D - \angle M C N = 90^{\circ} - 45^{\circ} = 45^{\circ}$,
thus $\triangle M C N \cong \triangle D C N$.
Hence, $N D = M N = x$.
Since $\angle N B C = 45^{\circ}$, then $\angle N B D = 90^{\circ}$.
Therefore, $N B^{2} + B D^{2} = N D^{2}$, which means $m^{2} + n^{2} = x^{2}$.