Extension of homorphisms on a divisible R-module Let $R$ be a principal ideal domain and let $M$ be a finitely generated $R$-module. Take $N$ a submodule of $M$ and let $P$ be a divisible $R$-module. Prove that any homomorphism $f: N \rightarrow P$ can be extended to a homomorphism $F: M \rightarrow P$. 
I'm having trouble looking where to begin. I know that if a $R$-module is free (with $R$ a PID), then every submodule is also free, but I'm not completely sure if this also holds for finitely generated $R$-modules (this of course is false with arbitrary rings).
I've tried looking at $M/N$ and defining $F$ on the finite generators of $M$ to no avail. 
Any help would be appreciated!
 A: More generally, you can prove the following (called Baer's criterion): Let $R$ be a ring. Assume that $P$ is an $R$-module with the property that every homomorphism $I \to P$ can be extended to a homomorphism $R \to P$, where $I$ is a left ideal of $R$ (when $R$ is a PID, then this precisely means that $P$ is divisible). Then this extension property actually holds in general: If $M$ a finitely generated $R$-module and $N \subseteq M$ a submodule, then every homomorphism $f : N \to P$ can be extended to a homomorphism $F : M \to P$. Actually one can get rid of the assumption that $M$ is finitely generated, using Zorn's Lemma. But here, in the finite case, we can use a simple induction instead, and assume that $M=N + Rm$ for some $m \in M$. Now consider $I=\{r \in R : r m \in N\}$ and apply the assumption to $I \to P, i \mapsto f(i m)$. This will produce some $p \in P$ with $f(i m)=i p$ for $i \in I$. Check that $F : M \to P, n + r m \mapsto f(n) + r p$ is a well-defined extension of $f$.
