Rank of free modules under reduction 
Suppose $R$ is a principal ideal domain, $M$ is a free $R$-module of rank $n$ and $f$ is any $R$-module homomorphism from $M$ to $R$. If $\mathfrak a$ is a non-trivial ideal in $R$ and $f_{\mathfrak a}$ is the map from $M$ to $R/\mathfrak a$ that is induced by $f$, then I believe the kernel of $f_{\mathfrak a}$ is again a free $R$-module of rank $n$.

However, I cannot find or produce a proof for such a result. It is the rank that is particularly important to me.
Can someone help, please?
 A: There is a general, very cool result that is of help here:


Theorem: Let $R$ be a commutative unital ring. Then, $R$ is a PID if and only if every submodule of a free module is free.


The direction of the theorem that you want is easy, at least in finite rank. 
Since $R$ is Noetherian, any f.g. module $M$ is a Noetherian $R$-module. Thus, all submodules are f.g. But, since they can't have torsion because $M$ is free, they themselves must be free by the structure theorem for PIDs.
Ok, as for your rank question. You have an SES
$$0\to \ker\varphi\hookrightarrow M\xrightarrow{\varphi}R/\mathfrak a\to0.$$
Let $k=\text{Frac}(R)$. Since, $k$ is a flat $R$-module you get an SES
$$0\to \ker\varphi\otimes_R k\hookrightarrow M\otimes_R k\hookrightarrow k\otimes_R R/\mathfrak a\to 0.$$
Since this is an SES of $k$-modules, and all $k$-modules SESs split (since all $k$-modules are free) we get that 
$$ (\ker\varphi\otimes_R k)\oplus (R/\mathfrak a\otimes_R k)\cong k\otimes M$$
Now, if $\ker\varphi$ is rank $m$, and $M$ is rank $n$ as $R$-modules, it's easy to see that $\ker\varphi\otimes_R k\cong k^m$ and $M\otimes_R k\cong k^n$. But, if $\mathfrak a$ is non-trivial, you see pretty easily that $(R/\mathfrak a)\otimes_R k=0$. So, our isomorphism since that $R^m\cong R^n$. By the invariant basis number property of commutative rings, it follows that $m=n$.
Note, that the above was just showing that rank is an additive function on SESs. In this case you just had that $\text{rk}(R/\mathfrak a)=0$.
