[proofplan]
We construct $G(M)$ explicitly as a quotient of the free abelian group on symbols indexed by elements of $M$. The quotient imposes precisely the relations saying that the symbol attached to $a+b$ equals the sum of the symbols attached to $a$ and $b$. Any monoid homomorphism $f:M\to A$ then extends first to the free abelian group and descends through the quotient because it respects those relations. Uniqueness follows because the images of the symbols indexed by elements of $M$ generate the [quotient group](/theorems/790).
[/proofplan]
[step:Build the abelian group by imposing the monoid addition relations]
For each $a\in M$, let $e_a$ be a formal symbol. Define the free abelian group
\begin{align*}
F:=\bigoplus_{a\in M}\mathbb Z e_a.
\end{align*}
Thus every element $x\in F$ has a unique expression
\begin{align*}
x=\sum_{a\in M} n_a e_a,
\end{align*}
where each $n_a\in\mathbb Z$ and all but finitely many $n_a$ are zero.
For $a,b\in M$, define
\begin{align*}
r_{a,b}:=e_{a+b}-e_a-e_b\in F.
\end{align*}
Let $R\le F$ be the subgroup generated by all elements $r_{a,b}$ with $a,b\in M$. Define
\begin{align*}
G(M):=F/R,
\end{align*}
and let
\begin{align*}
q:F\to G(M)
\end{align*}
be the quotient [group homomorphism](/page/Group%20Homomorphism). Since $F$ is abelian and $R$ is a subgroup, $G(M)$ is an abelian group.
[/step]
[step:Define the canonical monoid homomorphism into the quotient]
Define the map
\begin{align*}
\iota:M&\to G(M)
\end{align*}
\begin{align*}
a&\mapsto q(e_a).
\end{align*}
For $a,b\in M$, the element $r_{a,b}$ lies in $R$, so $q(r_{a,b})=0$. Hence
\begin{align*}
q(e_{a+b})-q(e_a)-q(e_b)=0.
\end{align*}
Therefore
\begin{align*}
\iota(a+b)=\iota(a)+\iota(b).
\end{align*}
It remains to check preservation of the identity element. Taking $a=b=0_M$ gives
\begin{align*}
r_{0_M,0_M}=e_{0_M}-e_{0_M}-e_{0_M}=-e_{0_M}.
\end{align*}
Since $r_{0_M,0_M}\in R$, also $e_{0_M}\in R$, and therefore
\begin{align*}
\iota(0_M)=q(e_{0_M})=0_{G(M)}.
\end{align*}
Thus $\iota:M\to G(M)$ is an identity-preserving monoid homomorphism.
[/step]
[step:Extend a monoid homomorphism from $M$ to the free abelian group]
Let $A$ be an abelian group, written additively, and let
\begin{align*}
f:M\to A
\end{align*}
be an identity-preserving monoid homomorphism. Define a group homomorphism
\begin{align*}
\Phi:F\to A
\end{align*}
by declaring, for every finitely supported family $(n_a)_{a\in M}$ of integers,
\begin{align*}
\Phi\left(\sum_{a\in M} n_a e_a\right):=\sum_{a\in M} n_a f(a).
\end{align*}
The sum on the right is finite, so it is defined in $A$. Since addition in $F$ and $A$ is computed coefficientwise and $A$ is an abelian group, $\Phi$ is a group homomorphism.
[guided]
The role of $F$ is to forget all relations in $M$ except the fact that each element $a\in M$ gives a generator. Because $F$ is the direct sum
\begin{align*}
F=\bigoplus_{a\in M}\mathbb Z e_a,
\end{align*}
an element of $F$ is a finite integer linear combination of the symbols $e_a$. Thus, once we decide that $e_a$ should be sent to $f(a)$, there is only one possible extension to a group homomorphism.
Define
\begin{align*}
\Phi:F\to A
\end{align*}
by
\begin{align*}
\Phi\left(\sum_{a\in M} n_a e_a\right):=\sum_{a\in M} n_a f(a),
\end{align*}
where the family $(n_a)_{a\in M}$ is finitely supported. This is well-defined because each element of the direct sum has a unique finite expression of this form, and the right-hand side is a finite sum in the abelian group $A$.
To check that $\Phi$ is a group homomorphism, take
\begin{align*}
x=\sum_{a\in M} n_a e_a
\end{align*}
and
\begin{align*}
y=\sum_{a\in M} m_a e_a
\end{align*}
in $F$, where the integer families $(n_a)_{a\in M}$ and $(m_a)_{a\in M}$ are finitely supported. Then
\begin{align*}
x+y=\sum_{a\in M}(n_a+m_a)e_a.
\end{align*}
Therefore
\begin{align*}
\Phi(x+y)=\sum_{a\in M}(n_a+m_a)f(a).
\end{align*}
Since $A$ is abelian, finite sums may be regrouped, giving
\begin{align*}
\Phi(x+y)=\sum_{a\in M}n_a f(a)+\sum_{a\in M}m_a f(a)=\Phi(x)+\Phi(y).
\end{align*}
Thus $\Phi:F\to A$ is a group homomorphism.
[/guided]
[/step]
[step:Show the extension descends through the defining quotient]
For every $a,b\in M$, the homomorphism property of $f$ gives
\begin{align*}
f(a+b)=f(a)+f(b).
\end{align*}
Hence
\begin{align*}
\Phi(r_{a,b})=\Phi(e_{a+b}-e_a-e_b)=f(a+b)-f(a)-f(b)=0.
\end{align*}
Since $R$ is generated by the elements $r_{a,b}$ and $\Phi$ is a group homomorphism, we have
\begin{align*}
R\subseteq \ker \Phi.
\end{align*}
Define
\begin{align*}
\overline f:G(M)\to A
\end{align*}
by
\begin{align*}
\overline f(q(x)):=\Phi(x)
\end{align*}
for $x\in F$. This is well-defined: if $q(x)=q(y)$, then $x-y\in R\subseteq\ker\Phi$, so $\Phi(x-y)=0$, and therefore $\Phi(x)=\Phi(y)$. Since $\Phi$ and $q$ are group homomorphisms, $\overline f$ is a group homomorphism.
For every $a\in M$,
\begin{align*}
(\overline f\circ\iota)(a)=\overline f(q(e_a))=\Phi(e_a)=f(a).
\end{align*}
Thus
\begin{align*}
\overline f\circ \iota=f.
\end{align*}
[/step]
[step:Prove uniqueness from the generating symbols]
Let
\begin{align*}
h:G(M)\to A
\end{align*}
be a group homomorphism satisfying
\begin{align*}
h\circ\iota=f.
\end{align*}
For every $a\in M$,
\begin{align*}
h(q(e_a))=h(\iota(a))=f(a)=\overline f(q(e_a)).
\end{align*}
The elements $q(e_a)$ with $a\in M$ generate $G(M)$ as an abelian group, because the elements $e_a$ generate $F$ and $q:F\to G(M)$ is surjective. Since two group homomorphisms out of an abelian group agree if they agree on a generating set, it follows that
\begin{align*}
h=\overline f.
\end{align*}
Therefore the homomorphism $\overline f:G(M)\to A$ is unique. This proves the stated universal property of $G(M)$ and $\iota$.
[/step]