Let $R$ be a ring with $1$, and let $f: M \rightarrow N$ be an $R$-module homomorphism. Suppose that $f$ is injective. Show that $N$ has a submodule $N'$ such that $N = f(M) \bigoplus N'$ if and only if there exists an $R$-module homomorphism $\alpha: N \rightarrow M$ such that $\alpha(f(m)) = m$ for all $m \in M$.
Can someone give me some hint on how to proceed?
Only if part:
Suppose $N=f(M)\bigoplus N'$. Any vector $n\in N$ has a unique decomposition $\,n=f(m)+n'$; $m$ is unique because $f$ is injective. Define $\alpha(n)=m$; as the decomposition and $m$ are unique, it is easy to check $\alpha$ is linear. More over, for the same reason, $\alpha(f(m))=m$.
If part:
Suppose such an $\alpha$ exists. Then $f\circ\alpha$ is a projector, i. e. $\,(f\circ\alpha)\circ(f\circ\alpha)=f\circ\alpha$. Indeed, $$(f\circ\alpha)\circ(f\circ\alpha)=f\circ(\alpha\circ f)\circ\alpha=f\circ1_M\circ\alpha=f\circ\alpha.$$
This implies that $$N=\operatorname{im}(f\circ\alpha)\bigoplus \ker(f\circ\alpha)$$ Indeed, for any $n\in N$, we can write $n=(f\circ\alpha)(n)+ \bigl(n-(f\circ\alpha)(n)\bigr) $, noting that $n-(f\circ\alpha)(n)\in\ker(f\circ\alpha)$ since $\,(f\circ\alpha)\circ(f\circ\alpha)=f\circ\alpha$.
Now, $\alpha$ is surjective, hence $\,\operatorname{im}(f\circ\alpha)=\operatorname{im}f$. Thus, setting $N'= \ker(f\circ\alpha)$, we have: $$N=f(M)\bigoplus N'.$$
Note: These considerations simply correspond to writing $$1_N=f\circ\alpha+(1_n-f\circ\alpha).$$