I just came across the following reasoning:
Although I do like the shortness of the proof, I do not think it is correct; am I right that I disagree? The book of Atiyah and Macdonald says that Coker$(g)=M''/g(M)$ and that this sequence is exact iff $f$ is injective, $g$ surjective and Coker$(f)\simeq M''$. Is it also true that Coker$(g)\simeq M$?
It is not true in general that $\operatorname{coker}(g) \cong M$. Indeed, in general $\operatorname{coker}(\varphi) = 0$ if and only if $\varphi$ is surjective, so exactness of the sequence tells you that $\operatorname{coker}(g) = 0$. We conclude that $\operatorname{coker}(g) \cong M$ if and only if $M = 0$.
Was this meant to show that if $0 \to M' \to M \to M'' \to 0$ is exact and $M''$ is finitely generated then $M$ is finitely generated? If so, something is seriously wrong, because this is false. As an extreme counterexample, let $M$ be anything which is not finitely generated, and use the identity map $M \to M$ to form a short exact sequence $0 \to M \to M \to 0 \to 0$. $0$ is finitely generated, but $M$ (by assumption) is not.
What is true is that if $0 \to M' \xrightarrow{f} M \xrightarrow{g} M'' \to 0$ is exact and both $M'$ and $M''$ are finitely generated, then $M$ is finitely generated.
Proof. Let $\{x_1, \dots, x_n\}$ generate $M''$ and let $\{y_1, \dots, y_k\}$ generate $M'$. For each $x_i \in M''$, choose (by surjectivity of $g$) some $\overline{x_i} \in M$ such that $g(\overline{x_i}) = x_i$. Now, let $m \in M$ be arbitrary. By assumption, $$g(m) = \sum_{i=1}^n a_i x_i$$ for some $a_1, \dots, a_n$. Let $r = \sum_{i=1}^n a_i \overline{x_i}$ so that $g(r) = g(m)$. Then $g(m-r) = 0$, so $m-r \in \ker(g) = \operatorname{img}(f)$. This means that $m-r = f(s)$ for some $s \in M'$. By assumption, $$s = \sum_{i=1}^k b_i y_i$$ for some $b_1, \dots, b_k$. Thus, $$m = r + f(s) = \sum_{i=1}^n a_i \overline{x_i} + \sum_{i=1}^k b_i f(y_i).$$ Since $m$ was arbitrary, $\{\overline{x_1}, \dots, \overline{x_n}, f(y_1), \dots, f(y_k)\}$ generates $M$. $\square$
Note: we didn't need that $f$ was injective, i.e. it would've been fine to start with a right exact sequence $M' \to M \to M'' \to 0$. If you prefer, you can start by replacing $M'$ with $\operatorname{img}(f)$ so you're back in the short exact sequence case. On the other hand, we really do need $g$ to be surjective (so that we can lift the generators of $M''$ to $M$), although this isn't an issue if we're looking at modules over a Noetherian ring, since then every submodule of a finitely generated module is finitely generated, and we can start by replacing $M''$ with $\operatorname{img}(g)$.