I need some help with this problem, it seems easy, but I don't get it.
Let $A$ be a ring, $M''$ and $P$ be $A$-modules and $f:P\rightarrow M''$ an homomorphism. Suppose that for each $A$-modules $M$ and $M'$ and any homomorphisms such that $0\rightarrow M'\rightarrow M\rightarrow M''\rightarrow 0$ is exact, then
$$0\rightarrow Hom_A(P,M')\rightarrow Hom_A(P,M)\rightarrow Hom_A(P,M'') \rightarrow 0$$
is exact. If $g:M\rightarrow M''$ is an epimorphism, show that there exists a homomorphism $h:P\rightarrow M$ such that $g\circ h=f$.
Thanks.
$0\rightarrow Hom_A(P,M')\rightarrow Hom_A(P,M)\rightarrow Hom_A(P,M'') \rightarrow 0$ is exact So $\phi :Hom_A(P,M)\rightarrow Hom_A(P,M'')$ is surjective. Hence there is an $h\in Hom (P,M)$ such that $\phi (h)=f$