Every $R$-module is a quotient of a free module I'm reading through my notes, and I have a theorem as the title says. As proof I have only a picture.

where $v:m\mapsto(0,...,0,1,0,...,0)$ and 1 is at $m$-th position.
I know, that $\oplus_M R$ is a free module generated by set  $M$, but is this all? I do not see how the statement is proved.
 A: You can think to the free module $F$ generated by $M$ as the set of functions $f\colon M\to R$ such that $\{m\in M:f(m)\ne0\}$ is finite. The map $M\to F$ is $x\mapsto e_x$, where
$$
e_x(m)=\begin{cases} 1 & m=x \\[4px] 0 & m\ne x \end{cases}
$$
Addition and scalar multiplication on $F$ are obviously defined. The surjective homomorphism $\varphi\colon F\to M$ is given by
$$
\varphi(f) = \sum_{m\in M}f(m)m
$$
Clearly,
$$
\varphi(e_x)=x
$$
A: You can take $\oplus_{m\in M}R_m$ where $R_m\simeq R$ and define $f:\oplus_{m\in M}R\rightarrow M$ by $f(1_m)=m, 1_m\in R_m$ is the neutral element, $f$ is surjective.
A: Recall the universal property of direct sum: if $M_j(j\in I)$ and $M$ are $R$-modules and $\{\phi_i\colon M_i\to M\}_{i\in I}$ are a family of homomorphisms, then there is a unique homomorphism $\phi\colon \bigoplus_{i\in I}M_i\to M$ making the following diagram commutative
$$
\begin{matrix}
M_j&\overset{\phi_j}{\longrightarrow}&M\\
\downarrow&\overset{\phi}{\nearrow}& \\
\oplus_{i\in I}M_i
\end{matrix}
$$
Now return to your problem. Generating a free $R$-module $R^{(M)}$ with the basis $M$, we define $\phi_m\colon R\to M$ by $\phi_m(1_R)=m$. Then the universal property provides an epimorphism $\phi\colon R^{(M)}\twoheadrightarrow M$.
