The question was asked by J. H. C. Whitehead in the 1950s, motivated by the second Cousin problem. The affirmative answer for countable groups was already found in the 1950s. Progress for larger groups was slow, and the problem was considered one of the most important ones in algebra for many years.
This result was completely unexpected. While the existence of undecidable statements had been known since Gödel's incompleteness theorem of 1931, previous examples of undecidable statements (such as the Continuum hypothesis) had been confined to the realm of set theory. The Whitehead problem was the first purely algebraic problem that was shown to be undecidable.
The Whitehead problem remains undecidable even if one assumes the Continuum hypothesis, as shown by Shelah in 1980. Various similar independence statements were proved and it was realized more and more that the theory of abelian groups depends very sensitively on the underlying set theory.