If $M=f(N)\oplus K$, then there is a left inverse to $f$ Suppose $f:N\to M$ is an injective $R$-module homomorphism and $f(N)$ is a direct summand of $M: M=f(N)\oplus K$ for a submodule $K\subset M$. I'm trying to show that there is a homomorphism $f':M\to N$ such that $f'(f(n))=n$ for $n\in N$.
It would be natural to define $f':M=f(N)\oplus K\to N$ by $(f(n),k)\mapsto n$. But since I don't know the explicit form of the map $f$, I cannot show that $f'(f(n))=n$.  How do I prove that without knowing what $f$ is?

We don't need to know what $f$ is, just that it's isomorphic onto its image. We could write the proof as follows:
Theorem: Suppose $f : N \rightarrow M$ is an injective $R$-module homomorphism and $f(N)$ is a direct summand of $M$. Then $f$ has a left inverse.
Proof: Take a submodule $K$ such that $M = f(N) \oplus K$ (internal direct sum). Then the map $g : N \rightarrow f(N)$ sending $x$ to $f(x)$ is surjective and injective, and therefore an isomorphism. Define a homomorphism $h : M \rightarrow N$ where, for $x \in f(N)$ and $y \in K$, we set $h(x + y) = g^{-1} (x)$. This is an $R$-linear homomorphism, since for $x, x' \in f(N)$ and $y, y' \in K$, we have 
$f(x + x' + y + y') = g^{-1} (x + x') = g^{-1} (x) + g^{-1}(x') = f(x + y) + f(x' + y')$
For $x \in f(N)$, $y \in K$, and $r \in R$, we have 
$f(r(x + y)) = f(rx + ry) = g^{-1} (rx) = r g^{-1} (x) = r f(x + y)$. 
This shows that $h$ is an $R$-linear homomorphism. Then we have $h(f(x)) = g^{-1} (f(x)) = g^{-1} (g (x)) = x$. So $h \circ f = \text{Id}_N$. 
