Question:

Find the group G generated under matrix multiplication by the matrices
$A=\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, B=\begin{pmatrix} 0 & i \\ i & 0 \end{pmatrix}.$
Determine its proper subgroups, and verify for each of them that its cosets exhaust G.

Step-by-step

Before we can draw up a group multiplication table to search for subgroups, we must determine the multiple products of A and B with themselves and with each other:
${A}^{2}=\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}=\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}=I$.
Since B = iA, it follows that ${B}^{2} = −I$, that AB = iI = BA, and that ${B}^{3} = −B$. In brief, A is of order 2, B is of order 4, and A and B commute. The eight distinct elements of the group are therefore: $I,A,B,{B}^{2},{B}^{3}, AB,A{B}^{2}$ and $A{B}^{3}$.
The group multiplication table is
By inspection, the subgroups and their cosets are as follows:
{I,A} : {I,A}, {B,AB}, {${B}^{2},A{B}^{2}$}, {${B}^{3},A{B}^{3}$};
{$I,{B}^{2}$} : {$I,{B}^{2}$}, {$A,A{B}^{2}$}, {$B,{B}^{3}$}, {$AB,A{B}^{3}$};
{$I,A{B}^{2}$} : {$I,A{B}^{2}$}, {$A,{B}^{2}$}, {$B,A{B}^{3}$}, {${B}^{3},AB$};
{$I,B,{B}^{2},{B}^{3}$} : {$I,B,{B}^{2},{B}^{3}$}, {$A,AB,A{B}^{2},A{B}^{3}$};
{$I,AB,{B}^{2},A{B}^{3}$} : {$I,AB,{B}^{2},A{B}^{3}$}, {$A,B,A{B}^{2},{B}^{3}$}.
As expected, in each case the cosets exhaust the group, with each element in one and only one coset.