Group extensions of cyclic groups Let $A$ be an infinite cyclic group and $B$ be a cyclic group of order $n$. Suppose 
$$0 \to A \to G \to B \to 0$$
is a short exact sequence of abelian groups. What could $G$ be? 
It is clear enough that $G = \mathbb{Z} \oplus C_m$ works, for all $m$ such that $m$ divides $n$ and $\textrm{gcd}(m, n/m) = 1$, by the Chinese remainder theorem. $A$ and $B$ are finitely generated, so $G$ is as well; thus the structure theorem for finitely-generated abelian groups tells us that this is exhaustive. However, is there a more direct approach (in the sense of not using a sledgehammer) to this easy-looking exercise? (It is exercise 6.2 in Massey's A basic course in algebraic topology.)
For example, by tensoring with $\mathbb{Q}$, we obtain a right-exact sequence
$$\mathbb{Q} \to G \otimes \mathbb{Q} \to 0 \to 0$$
which tells us that the free part of $G$ has rank at most $1$, and considering $\textrm{Hom}(-, \mathbb{Z})$, we get a right-exact sequence
$$0 \to \textrm{Hom}(G, \mathbb{Z}) \to \mathbb{Z} \to 0$$
which indicates the free part of $G$ has rank exactly $1$. What can we say about the torsion part?
 A: Consider the short exact sequence
$1 \rightarrow A \xrightarrow{ \phi } G \xrightarrow{ \psi } B\rightarrow 1$
where $\phi(A)=\langle x|- \rangle$ be infinite cyclic group, and $B=\langle \bar{y}| \bar{y}^n\rangle$ be finite cyclic group of order $n$.
($G$ may be abelian or may not be)
Since $G \xrightarrow{ \psi } B$ is surjective, $\exists$ $y\in G$ such that $\psi(y)=\bar{y}$. Then $\psi(y^{n})=\bar{y}^n=1$, so $y^n\in ker(\psi)=\phi(A)$.
Without loss of generality, let $y^{n}=x^{i}$ for some non-negative integer $i$
. It is clear that $G$ is generated by $x,y$.
Also as $A\triangleleft G$, we have $y^{-1}xy\in \phi(A)=\langle x |-\rangle$; so let $y^{-1}xy=x^{j}$ for $j\neq 0$.
Then $y^{-2}xy^{2}=x^{j^2}$, and continuing this $y^{-n}xy^{n}=x^{j^n}$, i.e $x=x^{j^n}$, since $y^n(=x^i)$ commutes with $x$.
So $j^n=1$ in $\mathbb{Z}$. Since $n>0$.
Case1: If $n$ is odd, then $j=1$ is its only solution.
Therefore $y^{-1}xy=x$, which means $G$ is an abelian group; it is quotient of $\mathbb{Z} \oplus \mathbb{Z}$:

$G=\langle x,y | y^{-1}xy=x, y^n=x^i \rangle$

(I didn't find more simplification of this! You may be interested in structure of these groups!)
Case 2: If $n$ is even, then $j=\pm 1$. Case $j=1$ has considered above.
So let $j=-1$. As $y^{-1}xy=x^{-1}$, we have $y^{-1}x^{i}y=x^{-i}$ i.e. $x^{i}=x^{-i}$, since $x^{i}(=y^n)$ commutes with $y$.  So $i=0$ i.e. $y^n(=x^i)=1$.
In this case $G$ is semidirect product of $\langle x|- \rangle \cong \mathbb{Z}$, and $\langle y|y^n\rangle \cong \mathbb{Z}/n$.
For this, we have to consider homomorphism from $\mathbb{Z}/n$ into $Aut(\mathbb{Z})\cong \mathbb{Z}_2$. Since $n$ is even, there are only two possibilities of homomorphisms -trivial and $y\mapsto \{x\mapsto x^{-1} \}$.
Therefore $G$ is one of the following:

$G=\langle x,y| y^n, y^{-1}xy=x\rangle \cong \mathbb{Z} \oplus \mathbb{Z}/n$
$G=\langle x,y| y^n, y^{-1}xy=x^{-1}\rangle \cong \mathbb{Z} \rtimes \mathbb{Z}/n$

