Lemma 15.54.1. An abelian group $J$ is an injective object in the category of abelian groups if and only if $J$ is divisible.

Proof. Suppose that $J$ is not divisible. Then there exists an $x \in J$ and $n \in \mathbf{N}$ such that there is no $y \in J$ with $n y = x$. Then the morphism $\mathbf{Z} \to J$, $m \mapsto mx$ does not extend to $\frac{1}{n}\mathbf{Z} \supset \mathbf{Z}$. Hence $J$ is not injective.

Let $A \subset B$ be abelian groups. Assume that $J$ is a divisible abelian group. Let $\varphi : A \to J$ be a morphism. Consider the set of homomorphisms $\varphi ' : A' \to J$ with $A \subset A' \subset B$ and $\varphi '|_ A = \varphi$. Define $(A', \varphi ') \geq (A'', \varphi '')$ if and only if $A' \supset A''$ and $\varphi '|_{A''} = \varphi ''$. If $(A_ i, \varphi _ i)_{i \in I}$ is a totally ordered collection of such pairs, then we obtain a map $\bigcup _{i \in I} A_ i \to J$ defined by $a \in A_ i$ maps to $\varphi _ i(a)$. Thus Zorn's lemma applies. To conclude we have to show that if the pair $(A', \varphi ')$ is maximal then $A' = B$. In other words, it suffices to show, given any subgroup $A \subset B$, $A \not= B$ and any $\varphi : A \to J$, then we can find $\varphi ' : A' \to J$ with $A \subset A' \subset B$ such that (a) the inclusion $A \subset A'$ is strict, and (b) the morphism $\varphi '$ extends $\varphi$.

To prove this, pick $x \in B$, $x \not\in A$. If there exists no $n\in \mathbf{N}$ such that $nx \in A$, then $A \oplus \mathbf{Z} \cong A + \mathbf{Z}x$. Hence we can extend $\varphi$ to $A' = A + \mathbf{Z}x$ by using $\varphi$ on $A$ and mapping $x$ to zero for example. If there does exist an $n \in \mathbf{N}$ such that $nx \in A$, then let $n$ be the minimal such integer. Let $z \in J$ be an element such that $nz = \varphi (nx)$. Define a morphism $\tilde\varphi : A \oplus \mathbf{Z} \to J$ by $(a, m) \mapsto \varphi (a) + mz$. By our choice of $z$ the kernel of $\tilde\varphi$ contains the kernel of the map $A \oplus \mathbf{Z} \to B$, $(a, m) \mapsto a + mx$. Hence $\tilde\varphi$ factors through the image $A' = A + \mathbf{Z}x$, and this extends the morphism $\varphi$. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).