Describe all groups of 8 elements I try to find all the groups of 8 elements.
I have found:


*

*$\mathbb{Z}_8$

*$\mathbb{Z}_2 \times \mathbb{Z}_4$

*$\mathbb{Z}_2 \times \mathbb{Z}_2 \times \mathbb{Z}_2$

*quaternions


I don't understand the idea of finding the others. Or how to show that they don't exist.
 A: The orders of all group elements are divisors of 8. We have already found the only group with an element of order 8 and the only group where all nonunit elements have order 2, so let us concentrate on the cases where $G=\{e,a,a^2,a^3,b,ba,ba^2,ba^3\}$ with neither $b$ or $a$ a power of the other. Then all possibilities can be exhausted by investigating what $ab$ and $b^2$ could be equal to.
A: You can go by steps. Suppose that $G$ is abelian. By classification (or by hand) the group is $C_2^3,C_4\times C_2, C_8$. Suppose $G$ is nonabelian. Then there is no element of order $8$, and not every element can be of order $2$. There is thus an element $a$ of order $4$, and $\langle a \rangle$ is a normal subgroup of $G$. Suppose now there is a unique element of order $2$, then this element must be $a^2$. Since we're short of elements, and there is a unique element of order $2$, there must exist an element $b$ of order $4$, and $b^2=a^2$. Since both $\langle a \rangle$ and $\langle b\rangle $ are normal, $bab^{-1}=a^i$ for some $i$. Since $i$ cannot be $1$ (for $G$ is nonabelian), and since $a$ has order $4$, so does $bab^{-1}$, hence $bab^{-1}=a^{-1}$. This the presentation $$G=\langle a,b\mid a^4=1,b^2=a^2,bab^{-1}=a^{-1}\rangle $$
of the quaternion group (although one should check this!). If there is not a unique element of order $2$, pick $b$ an element of order two different from $a^2$ and argue similarly to obtain a presentation of $D_4$. 
