Let $M$ be a finitely generated $R$-module and $f:M \rightarrow R^n$ a surjective homomorphism. By letting $e_1,\dots,e_n$ be the standard basis of $R^n$ and choosing $u_i \in M$ with $f(u_i) = e_i$ for $1 \leq i \leq n$,
(i) Show that $M = \ker(f) \bigoplus M_0$, where $M_0 \leq M$ is the submodule generated by the $u_i$.
(ii) Show that $\ker(f)$ is finitely generated.