TITLE: Non-split extension of the rationals by the integers 
QUESTION [32 upvotes]: Can someone describe explicitly an abelian group $A$ such that the extension $$0 \to \mathbb{Z} \to A \to \mathbb{Q} \to 0$$ doesn't split ? 
Background: The Stein-Serre theorem (Hilton, Stammbach: A course in homol. algebra, Theorem 6.1) states that if $A$ is abelian of countable rank (=maximal number of linear independent elements), then $Ext(A,\mathbb{Z})=0$ implies $A$ free. When applied to $A= \mathbb{Q}$, I  conclude $Ext(\mathbb{Q},\mathbb{Z})\neq 0$. Moreover, by interpreting $A \in Ext(\mathbb{Q},\mathbb{Z})$ as extension $0 \to \mathbb{Z} \to A \to \mathbb{Q} \to 0$ of abelian groups, there must be an $A$ such that the extension doesn't split. The problem is that the proof of the theorem isn't constructive and doesn't show how to construct such an $A$.

REPLY [12 votes]: Building on Ralph's answer a bit we can get uncountably many inequivalent examples as Mark Grant's comment on the original post suggested there should be.
Let $S,T$ be a partition of the primes into two nonempty sets (or if you prefer, the multiplicative sets generated by these).  Localize at these sets and form the sequence $0\to\mathbb{Z}\to S^{-1}\mathbb{Z}\oplus T^{-1}\mathbb{Z}\to\mathbb{Q}\to 0$, where the first map is $n\mapsto (n,-n)$ and the second is $(a,b)\mapsto a+b$.  (My comment on Ralph's answer was the case $T = \{p\}$.)  Then the same partial fractions argument as in Ralph's answer shows that this is an exact sequence which does not split.
Now let $U,V$ be another such partition of the primes.  Suppose there is an isomorphism $f: S^{-1}\mathbb{Z}\oplus T^{-1}\mathbb{Z}\to U^{-1}\mathbb{Z}\oplus V^{-1}\mathbb{Z}$ making the corresponding exact sequences equivalent.  Assume WLOG that $S$ contains at least two elements $p,r\in S$ and $p\in U$.
For any $k\geq 1$, equivalence of the exact sequences gives $f(1/p^k,0) = (a_k,b_k)$ where $a_k+b_k = 1/p^k$.  Since $p\in U$ and $U^{-1}\mathbb{Z}\cap V^{-1}\mathbb{Z} = \mathbb{Z}$, we get $(a_k,b_k) = (1/p^k + m_k,-m_k)$ for some $m_k\in\mathbb{Z}$.  The map $f$ is a homomorphism, so $f(1,0) = (1 + p^km_k, -p^km_k)$.  The value $k$ was arbitrary, so the second component of $f(1,0)$ is divisible by $p^k$ for all $k\geq 1$ and must be zero.  Therefore $m_k = 0$ and $f(1/p^k,0) = (1/p^k,0)$ for all $k\geq 0$.
The same argument shows that $f(1/r,0)$ is either $(1/r,0)$ or $(0,1/r)$ depending on whether $r\in U$ or $r\in V$.  The second case would make $f(1,0) = (0,1)$, contradicting the above, so $r\in U$.  In this way we obtain $S\subseteq U$.  The same arguments applied to the isomorphism $f^{-1}$ yield $U\subseteq S$, so $S=U$.
Thus the exact sequences are equivalent if and only if $\{S,T\} = \{U,V\}$.  There are uncountably many partitions of the primes into two nonempty sets, so there are uncountably many inequivalent non-split exact sequences $0\to\mathbb{Z}\to A\to\mathbb{Q}\to 0$.