I want to prove that an R-Module $J$ is injective if and only if whenever $J$ is a submodule of $M$, $J$ is a direct summand of $M$.
One implication is easy: If $J$ is injective and is a submodule of $M$, there is an injective morphism $i:J\rightarrow M $ (the inclusion) and by injectivity of $J$ there must exist some $f:M\rightarrow J $ such that $f \circ i =id $. From that it follows that $M$ is (Im f) $\oplus $ (Ker f), because x = f(x) + ( f(x) - x) and since Im f $\simeq$ $J$ we are done.
Im totally puzzled by the other implication, however. I tried using Baers criterion to make it easier, but since is about ideals $I$ of $J$ I have no clue on how to use the hypothesis.
Note how both statements are categorical. This directs us towards a “categorical” proof – ie one where as few specific properties of modules are used as needed.
Suppose that $J$ is a direct summand of any module it embeds into. Let’s show that $J$ is injective.
Let $N \subset M$ be modules and $f: N \rightarrow J$ be a homomorphism.
We have a morphism $(\mathrm{in},-f): N \rightarrow M \oplus J$, and write $K$ for its cokernel.
Then $J \rightarrow M \oplus J \rightarrow K$ is injective, so there exists a retraction $\psi: K \rightarrow J$.
In other words, there is a map $a \oplus b: M \oplus J \rightarrow J$ such that $b=\mathrm{id}$ (it’s a retraction) and $(a\oplus b)(\mathrm{in},-f)=0$ (it comes from $K$): so $a: M \rightarrow J$ is a map whose restriction to $N$ is given by $f$.