I am asked to find an isomorphism from the group $G = 1,i,-1,-i$ to the group $H = \begin{bmatrix} 1 & 0 \\[0.3em] 0 & 1 \end{bmatrix} , \begin{bmatrix} i & 0 \\[0.3em] 0 & -i \end{bmatrix} \begin{bmatrix} -i & 0 \\[0.3em] 0 & i \end{bmatrix} \begin{bmatrix} -1 & 0 \\[0.3em] 0 & -1 \end{bmatrix} $
it is easy to see that $f(1) = \begin{bmatrix} -1 & 0 \\[0.3em] 0 & -1 \end{bmatrix}$ and $f(-1) = \begin{bmatrix} -1 & 0 \\[0.3em] 0 & -1 \end{bmatrix}$ because identities must map to identities and also inverses must map to inverses and we observe that $-1$ is its own inverse same like $\begin{bmatrix} -1 & 0 \\[0.3em] 0 & -1 \end{bmatrix}$ and now we have two elements left to map to we can map $i$ to $\begin{bmatrix} -i & 0 \\[0.3em] 0 & i \end{bmatrix}$ and $-i$ to $\begin{bmatrix} i & 0 \\[0.3em] 0 & -i \end{bmatrix}$ ,this is an isomorphims but how to prove that $f(xy) = f(x)f(y)$