When I studied injective module there is a theorem which say that the two following statement are equivalent:
Let $R$ be a ring, $I$ is a left ideal of $R$, $J$ is a left $R$-module.
For every $f:I\longrightarrow J$ module homomorphism there exist $m\in J$ that $f(r)=rm$ for every $r\in I$
Every module homomorphism $f:I \longrightarrow J$ can be extended to a homomorphism $\bar{f}:R\longrightarrow J$.
Suppose we have 1 and we want to prove 2. Here is my argument:
Let $\pi : R\longrightarrow I$ with $\pi(r)=r$ where $r\in I$ and $\pi(r)=0$ otherwise. Then define $\bar{f}:R\longrightarrow J$ as $\bar{f}=f\circ \pi$.
I felt that my argument is not enough or even wrong, however, I had no idea of constructing such a homomorphism $\bar{f}$.
Please help me. Thanks