Figuring out a group in a short exact sequence I am going through the http://www.maths.ed.ac.uk/~v1ranick/papers/wallhomgroup.pdf
page 179.proof (ii) $\implies$ (iii).
My question given a short exact sequence
$1\rightarrow \mathbb{Z}  \rightarrow X \rightarrow \mathbb{Z}_2 \rightarrow 1,$
What can the group  X be?
Are there only really two options  $\mathbb{Z}_2 *\mathbb {Z}_2$ and an abelian one (i am presuming it is the direct(semi?) of these two things).I want to conclude that it is indeed $\mathbb{Z}_2 *\mathbb {Z}_2$ if i rule out the abelian case.  
There is a lot more setting in the proof ,but i "believe" my question is this.I might be missing important pieces of the puzzle.
 A: Edit: The exercise below may be considerably reduced if you know about extensions and 2nd cohomology group. 
Consider in $X$, one element $x_0$ such that $\pi(x_0)\neq 0$ where $\pi$ is the natural projection $X\to \mathbb{Z}/2$. 
Remark that $Aut(\mathbb{Z})$ has two elements $$1\mapsto 1\text{ and } 1 \mapsto -1$$ and that the conjugation action of $x_0$ on $X$ restricted to $\mathbb{Z}$ is an automorphism of $\mathbb{Z}$. There are two cases:


*

*case $1$ : $x_0$ induces $1\mapsto 1$ on $\mathbb{Z}$. Then $X$ is abelian. Remark that $x_0*x_0$ belongs to $\mathbb{Z}$ and can therefore be written as $n\cdot 1$. I claim a bunch of things that you can check by yourself: the parity of $n$ does not depend on the chosen lift $x_0$, if $n=2k$ (case $1a$) then we can take $x_0$ to be of order $2$ and if $n=2k+1$ (case $1b$) then we can take $x_0$ so that $x_0*x_0=1$. In case $1a$, $X$ is isomorphic to $\mathbb{Z}\times \mathbb{Z}_2$. In case $1b$, $X$ is isomorphic to $\mathbb{Z}$ (remark that the map $\mathbb{Z}\to X$ is given by $1\mapsto 2$). 

*case $2$ : $x_0$ induces $1\mapsto -1$ on $\mathbb{Z}$. I claim that $x_0*x_0$ needs to be $0\in\mathbb{Z}$ (if you have trouble doing this, I include a hint below). As a result, $1\mapsto x_0$ is a cross-section for $\mathbb{Z}$ and therefore: $X$ is isomorphic to $\mathbb{Z}\rtimes \mathbb{Z}/2$ where the semi-direct product is given by the usual operation. Now you are done. Because we have shown that there is a single non-abelian option for such extension.  You can recover the free product $\mathbb{Z}_2*\mathbb{Z}_2$ by considering $x_0$ and $1*x_0$ which are both of order $2$. 
Hint for case $2$:

 $x_0*x_0$ is fixed by the action of $x_0$.

