All modules are over a ring $R$ which is a PID. I wanted to show that every submodule of a finitely generated module is finitely generated. A key to this problem seems to be the following theorem (not too hard to prove by induction) :
Every submodule $M$ of $R^n$ has a basis with at most $n$ elements. That is, $M \cong R^m$ for $m\leq n.$
Now, my latest attempt at a proof goes like this: Let $M$ be our finitely generated submodule, generated by $x_1, \cdots, x_n.$ Then the R-module homomorphism $\phi: R^n \to M$, $ (r_1, \cdots, r_n) \mapsto r_1 x_1 + \cdots + r_n x_n$ is surjective. Suppose $N$ is a submodule of $M$; we want to show that $N$ is finitely generated. The preimage of $N$ under $\phi$ is a submodule of $R^n$, so by our theorem, $\phi^{-1}(N)$ has a basis $y_1, \cdots, y_m$ for some $m\leq n.$ Now, $N=\phi( \phi^{-1}(N))$ so N is generated by $\phi(y_1),\cdots \phi(y_m).$
That proof seems to be fine, but my first "proof" was somewhat different:
1) $R^n$ is semi-simple: Every submodule $N$ of $R^n$ is isomorphic to $R^m$ for some $m\leq n$ so letting $N'= R^{n-m}$ we have $R^n= N \oplus N'$.
2) If $N$ is a submodule of $M$ then there is another submodule $N'$ such that $M= N \oplus N'$ so $M/N \cong N',$ which allows us to identify submodules and quotient modules.
The argument goes like this:
a) Suppose $M$ is a finitely generated $R$ module, generated by say $n$ elements, so $M \cong R^n/\ker \phi$ where $\phi$ is the same homomorphism in the new proof above.
b) By 1) and 2) $R^n/\ker \phi$ is isomorphic to some submodule of $R^n$, and that submodule is isomorphic to $R^m$ for some $m\leq n$ by our theorem.
c) Joining these up, we get $M\cong R^m$ *for some $m\leq n.$ Now by our theorem, any submodule $N$ of $M$ is isomorphic to $R^k$ for $k\leq m$ and thus finitely generated.
Now, the claims seem ridiculous to me starting around where I put the asterisk. In particular, it would appear to prove that any finitely generated module is free. I can't think of a counterexample over a PID right now, but that seems like it can't be true. What have I done wrong?