TITLE: Quaternion group as an extension
QUESTION [8 upvotes]: I'm trying to understand how the quaternion group Q arises as an extension of $\mathbb{Z}_{4}$ by $\mathbb{Z}_{2}$.
More precisely, I'm trying to find the two homomorphisms in the short exact sequence $\mathbb{Z}_{4} \to Q \to \mathbb{Z}_{2}$.
For now, it is quite easy to find an injective homomorphism $\psi_1$ of $\mathbb{Z}_{4} \to Q$, as well as to find the surjective homormophism $\psi_2$ of $Q \to \mathbb{Z}_{2}$ such that $Ker(\psi_2)=Im(\psi_1)$. However, I'm left with 4 elements in Q which I don't know how to map via $\psi_2$.
Incidentally, there is a more general question to my problem (actually two) :

How does one find $\psi_1$ and $\psi_2$ from the group structure ?
How does one recover the group structure of an extension, knowing $\psi_1$ and $\psi_2$ (and any splitting map that might occur).

REPLY [7 votes]: Since $\mathbb{Z}_4\cong \langle i\rangle$ is a normal subgroup of index $2$ in $\mathbb{Q}_8$ (with usual notation $i,j,k $ etc.) So $\mathbb{Q}_8/\mathbb{Z}_4\cong \mathbb{Z}_2$. This is exactly equivalent to the given (short exact) sequence in your question:
$\mathbb{1}\rightarrow \mathbb{Z}_4 \hookrightarrow G \twoheadrightarrow \mathbb{Z}_2 \rightarrow \mathbb{1}$
We can recover group(groups) of such type in following way:
If $G$ is an extention of $\mathbb{Z}_4=\langle b|b^4\rangle$ by $\mathbb{Z}_2=\langle a|a^2\rangle$, then let $x$ be an element of $G$ such that $\psi_2(x)=a$; then we see that $x^2\mapsto 1$, so $x^2\in ker(\psi_2)=im(\psi_1)=\mathbb{Z}_4$.
1) If $x^2=b$ or $b^3$, then $x$ will be an element of order $8$ in $G$, so

$G\cong \mathbb{Z}_8$.

2) If $x^2=b^2$, then $x^4=1$. Also as $\langle b\rangle \triangleleft G$, so $x^{-1}bx\in \langle b \rangle$. Since $|b|=|x^{-1}bx|$, the only possibilities are $x^{-1}bx=b$ or $x^{-1}bx=b^3$.
2.1)  The case $x^{-1}bx=b$ shows that $G$ is abelian; that $G$ is generated by elements $x,b$ of order $4$, with relation $x^2=b^2$. So 

$G=\langle x,b| x^4, b^4, x^2=b^2, x^{-1}bx=b\rangle \cong \mathbb{Z}_4 \times \mathbb{Z}_2$

2.2) The case $x^{-1}bx=b^3$ shows that $G$ is generated by $x,b$, with relations $x^4=1$, $b^4=1$, $x^2=b^2$, and $x^{-1}bx=b^3$; this is the group 

$G =\langle x,b| x^{4}, b^{4}, b^{2}=x^{2}, x^{-1}bx=b^{3} \rangle \cong \mathbb{Q}_8$.

3) If $x^2=1$, then as $\langle b\rangle \triangleleft G$, we see that $x^{-1}bx\in \langle b \rangle$; so it is either $b$ or $b^{3}$.
3.1)The case $x^{-1}bx=b$ shows $G$ is abelian and 

$G=\langle x,b| x^2, b^4, x^{-1}bx=b \rangle \cong \mathbb{Z}_4 \times \mathbb{Z}_2$.

3.2) The last case $x^{-1}bx=b^{3}$ shows that 

$G=\langle x,b| x^2, b^4, x^{-1}bx=b^{3} \rangle \cong D_8$.
These are, precisely, extentions of $\mathbb{Z}_4$ by $\mathbb{Z}_2$.

Remark The argument is using only construction of groups by generators and relations.
Such argument is useful to obtain structure of group with exact sequences; it works for $p$ groups of small order also. But as we go for groups of higher order, the generators (and hence relations) may increase. So this argument is useful only for small groups. Knowing the type of extention (split, central etc.) gives possible relations easily, but this is not always the case in $p$ groups.