It is well-known that over a PID such as $\mathbb{Z}$, a submodule of a free module is free. In particular, projective modules are the same as free modules in this case.
As in the OP, let $L: \text{Set} \to \text{Mod}_\mathbb{Z}$ be the free functor which is left adjoint to the forgetful functor $U: \text{Mod}_\mathbb{Z} \to \text{Set}$. There is a canonical counit map $\pi_A: LU(A) \to A$ for any module $A$; it sends each generator $a$ of $LU(A)$ (coming from the underlying set of $A$) to $A$. It is thus surjective.
If $\hom(A, -)$ preserves the exact sequence $LU(A) \stackrel{\pi_A}{\to} A \to 0$, then the induced map
$$\hom(A, LU(A)) \stackrel{\hom(1_A, \pi)}{\to} \hom(A, A)$$
would be surjective, so that there would exist $s \in \hom(A, LU(A))$ mapping onto the identity $1_A: A \to A$. By definition of the hom-functor $\hom(A, -)$, this means precisely that $\pi_A \circ s = 1_A$. This forces $s$ to be a monomorphism (since $1_A$ is of course a monomorphism), so that $s: A \to LU(A)$ maps $A$ isomorphically onto its image, which is a subgroup of the free abelian group $LU(A)$, making $A$ itself free abelian.
In particular, if we know that $A = \prod \mathbb{Z}$ (an infinite power of $\mathbb{Z}$) is not free abelian (which in itself is an interesting result), then by the above we have exhibited an exact sequence that is not preserved by $\hom(A, -)$.