Short Exact Sequences & Rank Nullity This is a well known lemma that consistently appears in textbooks, either as a statement without proof, or as an exercise (see for example pp. 146 of Hatcher)
If $0 \stackrel{id}{\to} A \stackrel{f}{\to} B \stackrel{g}{\to} C\stackrel{h}{\to} 0$ is a short exact sequence of finitely generated abelian groups, then $\operatorname{rank} B = \operatorname{rank} A + \operatorname{rank} C$.
I've been trying to prove this unsuccessfully. 
What do we know? $f$ is injective, $g$ is surjective, $\mathrm{Im} f = \mathrm{ker} g$, $\mathrm{Im} g = \mathrm{ker} h$, $C\simeq B/A$
So I start with a maximally linearly independent subset $\{ a_\alpha \}$ of $A$ such that the sum (with only finite non-zero entries)
$$\sum n_\alpha a_\alpha=0$$ for $n_\alpha \in \mathbb{Z}$, implies that $n_\alpha=0$. 
Where to go from here is a puzzle? Any hints would be appreciated
 A: If you're not familiar with tensor products, then learning them for this problem is overkill. But if you are familiar with them, then I think the following solution is nice.
$\newcommand{\Q}{\mathbb{Q}}
\newcommand{\Z}{\mathbb{Z}}$
For a finitely generated abelian group $A$, note that $\mathrm{rank}(A) = \dim_\Q(A\otimes_\Z \Q)$. One can show (basically following Arturo's answer) that given a short exact sequence of abelian groups $0\to A\to B\to C\to 0$, the sequence obtained by tensoring with $\Q$ is also exact:
$$0\to A\otimes_\Z \Q \to B\otimes_\Z \Q \to C\otimes_\Z \Q \to 0$$
Now the statement about ranks boils down to an easy statement about how dimensions of vector spaces add in a short exact sequence. 
A: Pick a maximal linearly independent subset $\{c_{\beta}\}$ of $C$. Now push the $a_{\alpha}$ to $B$ using $f$, and for each $c_{\beta}$ pick $c'_{\beta}\in B$ such that $g(c'_{\beta}) = c_{\beta}$. 
Now suppose that you have a finite linear combination of the $a_{\alpha}$ and the $c'_{\beta}$ that is equal to $0$,
$$n_{\alpha_1}f(a_{\alpha_1}) + \cdots + n_{\alpha_k}f(a_{\alpha_k}) + m_{\beta_1}c'_{\beta_1} + \cdots + m_{\beta_{\ell}}c'_{\beta_{\ell}} = 0.$$
Use $g$ to get a conclusion about the $m_{\beta_j}$; then use $f$ to get a conclusion about the $n_{\alpha_i}$. This will give you that $\mathrm{rank}(B)\geq \mathrm{rank}(A)+\mathrm{rank}(C)$. 
Do you also need help with the converse inequality?
A: This holds for integral domains $R$ and finitely generated $R$-modules. If we put $A = M_1, B = M_2,$ and $C = M_3$, then the given short exact sequence is isomorphic to the following short exact sequence:
$$
0 \to M_1 \to M_2 \to M_2/M_1 \to 0.
$$
If $r_1 = \operatorname{rank}M_1$, $r_2 = \operatorname{rank} M_2$, and $r_3 = \operatorname{rank} M_3 = \operatorname{rank} M_2/M_1$, then let $u_1,\dots,u_{r_1}$ be linearly independent in $M_1$ and $\bar v_1,\dots,\bar v_{r_3}$ be linearly independent in $M_2/M_1$. Then, if
$$
a_1u_1 + \dotsb + a_{r_1}u_{r_1} + b_1v_1 + \dotsb + b_{r_3}v_{r_3} = 0,
$$
in $M$, then reducing this equation modulo $M_1$ gives
$$
b_1\bar v_1 + \dotsb + b_{r_3}\bar v_{r_3} = \bar 0\quad\text{in $M_2/M_1$},
$$
so $b_1 = \dots = b_{r_3} = 0$ by linear independence of these elements, and thus $a_1 = \dotsb = a_{r_1} = 0$ by linear independence of the $u_i$. Hence $\operatorname{rank} M_2 \geqslant r_1 + r_3$.
Suppose that $w_1,\dots,w_s$ are linearly independent in $M_2$ with $s > r_1 + r_3$. Now (exercise) there is a free submodule $N/M_1\subset M_2/M_1$ with $R^{r_3}\cong N/M_1$ such that $(M_2/M_1)\big/(N/M_1)\cong M_2/N$ is a torsion module.
Since $N/M_1$ is free of rank $r_3$, there is $0\leqslant n\leqslant r_3$ such that $n$ of the $\bar w_1,\dots,\bar w_s$ are nonzero in $M_2/M_1$ and belong to $N/M_1$. After reindexing, assume that $\bar w_1,\dots,\bar w_{s-n}$ are either zero in $M_2/M_1$ or belong to $(M_2/M_1)\smallsetminus(N/M_1)$. Since $0\leqslant n\leqslant r_3$, we have $s-n\geqslant s-r_3 > r_1$. Removing the elements in the list that are equal to $\bar 0$ in $M_2/M_1$ and reindexing, we obtain a new list $\bar w_1,\dots,\bar w_j$ with $0\leqslant j \leqslant s-n$ and such that each $\bar w_j$ is nonzero in $M_2/M_1$, and even nonzero in $T:=(M_2/M_1)\big/(N/M_1)$. Since $T$ is a torsion module, for each $j$, there is an $x_j\in R\smallsetminus\{0\}$ such that $x_j\bar w_j = \bar 0 \bmod N/M_1$ in $T$. Thus, we end up with $s-n > r_1$ elements:
$$x_1\bar w_1=\dots=x_j\bar w_j=\bar w_{j+1}=\dots=\bar w_{j+(s-n-j)}=\bar w_{s-n}=\bar 0\quad\text{in $N/M_1$}.
$$
Thus, we have $x_1w_1,\dots,x_jw_j,w_{j+1},\dots,w_{s-n}$ belong to $M_1$, and it is easy to see that these elements are linearly independent in $M_1$ since $R$ is an integral domain and the elements $w_1,\dots,w_j,w_{j+1},\dots,w_{s-n}$ are linearly independent by assumption. But the rank of $M_1$ is $r_1 < s-n$, so this is a contradiction. Consequently, $\operatorname{rank} M_2 \leqslant r_1 + r_3$, so 
$$
\operatorname{rank} M_2 = r_1 + r_3 = \operatorname{rank} M_1 + \operatorname{rank} M_3,
$$
as desired.
