Injective modules characterization. Let $A$ be a commutative ring. An $A$-module $M$ is called injective if every monomorphism $f: M \to N$ of $A$-modules has a left inverse, i.e. if there exists a module morphism $g: N \to M$ such that $g \circ f = \text{id}_{M}$. I have to prove that if $M$ is injective, given an exact short sequence of $A$ modules
$$ 0 \to N_{1} \to N_{2} \to N_{3} \to 0,$$
then
$$ 0 \to \text{Hom}(N_{3}, M) \to \text{Hom}(N_{2}, M) \to \text{Hom}(N_{1}, M) \to 0$$
is an exact short sequence. (I've have proven the other implication, i.e. if $\text{Hom}(-,M)$ i s  and exact functor, then $M$ is injective). Thanks in advance.
 A: Denote the map $N_1\to N_2$ by $\iota $, and let $\varphi \in \text{Hom}(N_1,M)$.  We then  need to find  $\psi \in \text{Hom}(N_2,M)$,  such
that $\psi \circ \iota =\varphi $.
Consider the submodule of $M\times N_2$ given by
$$
  H=\Big\{\big (\varphi (x), -\iota (x)\big ): x\in  N_1\Big\},
  $$
and let $P=(M\times N_2)/H$.  I then claim
that the map
$$
  f: m\in M\mapsto (m, 0)+H \in  P
  $$
is injective.  Indeed, if $(m,0)\in  H$ then $(m,0)=\big (\varphi (x), -\iota (x)\big )$, for some $x$ in $H$, hence $\iota (x)=0$, so $x=0$ by
injectivity of $\iota $, and  $m=\varphi (x)=0$, as well.
Using the injectivity of $M$, in the form described by the OP, there exists $g:P \to M$  such that $g\circ f$ is the
identity on $M$.   We then define
$$
  \psi :y\in N_2\mapsto g\big ((0, y)+H\big )\in M,
  $$
and observe that, for every $x$ in $N_1$, one has that
$$
  \psi \big (\iota (x)\big ) =
  g\big ((0, \iota (x))+H\big )=
  g\big ((0, \iota (x))+(\varphi (x), -\iota (x))+H\big ) = $$$$ =
  g\big ((\varphi (x), 0)+H\big ) = g(f(\varphi (x))) = \varphi (x),
  $$
as desired.
EDIT:  If you are wondering where does $P$ come from, it is just the push forward of the pair of maps $(\iota ,\varphi )$.
Whenever the top horizontal map is one-to-one  in a
push forward diagram, so is the bottom horizontal map,  in this case $f$.  Using the
injectivity of $M$, we get the left inverse $g$, and then $\psi $, from $N_2$ to $M$,  is just the composition "down" then "left".
$\qquad\qquad\qquad\qquad$
