[step:Show that $\mathbb{Q}/\mathbb{Z}$ is an injective cogenerator for abelian groups]
We regard abelian groups as $\mathbb{Z}$-modules. Let
\begin{align*}
E := \mathbb{Q}/\mathbb{Z}
\end{align*}
be the quotient abelian group. We prove two facts: every homomorphism from a subgroup into $E$ extends to the whole group, and every nonzero element of an abelian group is detected by some homomorphism into $E$.
[claim:$E$ is injective as a $\mathbb{Z}$-module]
[/claim]
[proof]
Let $A$ be an abelian group, let $B \subset A$ be a subgroup, and let
\begin{align*}
f: B \to E
\end{align*}
be a group homomorphism. We must extend $f$ to a homomorphism $A \to E$.
Let $\mathcal{P}$ be the set of pairs $(C,g)$ such that $C$ is a subgroup of $A$ with $B \subset C$, and
\begin{align*}
g: C \to E
\end{align*}
is a group homomorphism satisfying $g|_B = f$. Partially order $\mathcal{P}$ by declaring $(C,g) \leq (C',g')$ if $C \subset C'$ and $g'|_C = g$. The pair $(B,f)$ belongs to $\mathcal{P}$. If $\{(C_i,g_i)\}_{i \in I}$ is a chain in $\mathcal{P}$, define
\begin{align*}
C_\infty := \bigcup_{i \in I} C_i.
\end{align*}
Because the family is a chain, $C_\infty$ is a subgroup of $A$. Define
\begin{align*}
g_\infty: C_\infty \to E
\end{align*}
by $g_\infty(c) := g_i(c)$ whenever $c \in C_i$. This is well-defined because the chain condition makes the homomorphisms agree on overlaps, and it is a group homomorphism extending $f$. Hence every chain has an upper bound, so [Zorn's lemma](/theorems/1226) gives a maximal pair $(C,g) \in \mathcal{P}$.
We claim that $C=A$. Suppose not, and choose $a \in A \setminus C$. Let $C + \mathbb{Z}a$ be the subgroup generated by $C$ and $a$. There are two cases.
First suppose that no positive integer $n$ satisfies $na \in C$. Then every element of $C+\mathbb{Z}a$ has a unique form $c+ka$ with $c \in C$ and $k \in \mathbb{Z}$. Define
\begin{align*}
\tilde g: C+\mathbb{Z}a \to E
\end{align*}
by
\begin{align*}
\tilde g(c+ka) := g(c).
\end{align*}
Uniqueness of the representation makes $\tilde g$ well-defined, and direct addition shows that it is a homomorphism extending $g$. This contradicts maximality of $(C,g)$.
Second suppose that some positive integer $n$ satisfies $na \in C$. Let $n_0$ be the least positive integer with $n_0a \in C$. Since $E=\mathbb{Q}/\mathbb{Z}$ is divisible, multiplication by $n_0$ on $E$ is surjective. Therefore there exists $e \in E$ such that
\begin{align*}
n_0 e = g(n_0a).
\end{align*}
Define
\begin{align*}
\tilde g: C+\mathbb{Z}a \to E
\end{align*}
by
\begin{align*}
\tilde g(c+ka) := g(c)+ke.
\end{align*}
To check well-definedness, suppose $c+ka=c'+k'a$ with $c,c' \in C$ and $k,k' \in \mathbb{Z}$. Then $(k-k')a=c'-c \in C$. By minimality of $n_0$, the integer $k-k'$ is divisible by $n_0$, so $k-k'=qn_0$ for some $q \in \mathbb{Z}$. Hence
\begin{align*}
g(c)-g(c') &= g(c-c') \\
&= g((k'-k)a) \\
&= g(-qn_0a) \\
&= -qg(n_0a) \\
&= -qn_0 e \\
&= (k'-k)e.
\end{align*}
Thus $g(c)+ke=g(c')+k'e$, so $\tilde g$ is well-defined. It is a homomorphism by direct computation and extends $g$, again contradicting maximality.
Both cases contradict $C \ne A$, so $C=A$. Therefore $f$ extends to a homomorphism $A \to E$, proving that $E$ is injective as a $\mathbb{Z}$-module.
[/proof]
[claim:$E$ detects nonzero elements of abelian groups]
[/claim]
[proof]
Let $A$ be an abelian group and let $a \in A$ with $a \ne 0$. Let $C := \mathbb{Z}a \subset A$ be the cyclic subgroup generated by $a$.
If $a$ has infinite order, define
\begin{align*}
h_0: C \to E
\end{align*}
by $h_0(ka) := k(1/2+\mathbb{Z})$ for $k \in \mathbb{Z}$. Then $h_0(a)=1/2+\mathbb{Z} \ne 0$.
If $a$ has finite order $n \geq 2$, define
\begin{align*}
h_0: C \to E
\end{align*}
by $h_0(ka) := k(1/n+\mathbb{Z})$ for $k \in \mathbb{Z}$. This is well-defined because $n(1/n+\mathbb{Z})=0$, and $h_0(a)=1/n+\mathbb{Z} \ne 0$.
In both cases, the injectivity of $E$ just proved extends $h_0$ to a homomorphism
\begin{align*}
h: A \to E
\end{align*}
with $h(a) \ne 0$.
[/proof]
[/step]