5. In Rt $\triangle A B C$, $\angle C=90^{\circ}, A C=3$, $B C=4$. Then the value of $\cos (A-B)$ is ( ).
(A) $\frac{3}{5}$
(B) $\frac{4}{5}$
(C) $\frac{24}{25}$
(D) $\frac{7}{25}$
5.C.

In $\triangle A B C$, construct $\angle B A D=\angle B$ (with $D$ on side $B C$), then $B D=A D$.
Let $A D=x$, then $C D=4-x$.
In the right triangle $\triangle A C D$, by the Pythagorean theorem we have
$$
3^{2}+(4-x)^{2}=x^{2} .
$$

Solving for $x$ gives $x=\frac{25}{8}$.
Thus, $\cos (A-B)$
$$
=\cos \angle C A D=\frac{A C}{A D}=\frac{24}{25} .
$$