We have a surjective homomorphism φ: G → H. We know Ker φ ≅ ℤ and H ≅ ℤ. Then it follows G ≅ ℤ ⊕ ℤ, right?
In general, if is a surjective homomorphism with kernel K, then G is (isomorphic to) a semidirect product of K and H. The above example is the semidirect product , where the action of on itself comes from the automorphism of the additive group
An example of a group which is an extension of two groups H and K but is not a semidirect product of H with K is the group,
It contains a (normal) subgroup isomorphic to of finite index, so it is an extension of by a finite group. But it does not split. See here for an explanation as to why.
Ok, I got this response from another board and thought I'd copy it here:
In general if you have a surjective morphism G->H with kernel N, then G is a semidirect product of N and H, and it is not necessarily the direct product.
In your case where N and H are ℤ, the 2 elements of Aut(ℤ) (Id and -Id) give 2 possibilities : the first one is ℤ ⊕ ℤ, and the second one is a group generated by two elements a and b of infinite order with the relation b a b^-1 = a^-1.
However if you already know that G is commutative then it must be the direct product.
It is an easy proof to show that is normal, and is isomorphic to , and that if we quotient out by we get . Thus, according to this answer, you have that is a semidirect product of and . Therefore, contains a copy of (indeed, it must be by the last line!). This is clearly false, as is torsion free (every element is a power of the generating element).
If you have two groups and and is another group such that then all that can be said is that is an extension of by . For an extension to be a semidirect product you need it to split.