Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 1.6 Exercise 1.6.26
Let $i$ and $j$ be the generators of $Q_8 = \langle i, j \ |\ i^4 = j^4 = 1, i^2 = j^2, ji = i^3 j \rangle$. Prove that the map $\varphi : Q_8 \rightarrow GL_2(\mathbb{C})$ defined on generators by $\varphi(i) = A = \left[ {\sqrt{-1} \atop 0} {0 \atop -\sqrt{-1}} \right]$ and $\varphi(j) = B = \left[ {0 \atop 1} {-1 \atop 0} \right]$ extends to a homomorphism. Prove that $\varphi$ is injective.
Solution: First we prove a lemma.
Lemma. Let $S = \{ i,j \}$ and $G$ be a group. If $\overline{\varphi} : S \rightarrow G$ such that $\overline{\varphi}(i)^4 = \overline{\varphi}(j)^4 = 1$, $\overline{\varphi}(i)^2 = \overline{\varphi}(j)^2$, and $\overline{\varphi}(j) \overline{\varphi}(i) = \overline{\varphi}(i)^3 \overline{\varphi}(j)$, then $\overline{\varphi}$ extends to a homomorphism $\varphi : Q_8 \rightarrow G$. Moreover, if $\overline{\varphi}(j)$ is not a power of $\overline{\varphi}(i)$ and the powers $\overline{\varphi}(i)^k$ are distinct for $0 \leq k < 4$, then $\varphi$ is injective.
Proof: We have that $\overline{\varphi}(i)$ and $\overline{\varphi}(j)$ satisfy the relations of $Q_8$. Now every element of $Q_8$ can be written uniquely in the form $i^aj^b$ for some $0 \leq a < 4$ and $0 \leq b < 2$; define $\varphi(i^aj^b) = \overline{\varphi}(i)^a \overline{\varphi}(j)^b$. It is straightforward to see that $\varphi$ is in fact a homomorphism. To see injectivity, let $0 \leq a,c < 4$ and $0 \leq b,d < 2$ and suppose $\varphi(i^aj^b) = \varphi(i^cj^d)$ but that $i^aj^b \neq i^cj^d$. Then either $a \neq c$ or $b \neq d$. If $b \neq d$, then without loss of generality we have $b = 1$ and $d = 0$. Thus $\overline{\varphi}(j) = \overline{\varphi}(i)^{c-a}$, a contradiction. If $b = d$ and $a \neq c$, then we have $\overline{\varphi}(i)^a = \overline{\varphi}(i)^c$, a contradiction. Thus $\varphi$ is injective. $\blacksquare$
By the lemma, it suffices to show that (1) $A^4 = B^4 = I$, (2) $A^2 = B^2$, (3) $BA = A^3B$, (4) $B \neq A^k$ for all integers $k$, and (5) $A^k$ are distinct for $k \in \{ 0,1,2,3 \}$. All but (4) are established by a simple calculation. To see (4), note that A is diagonal; so all powers of $A$ are diagonal. But $B$ is not diagonal. Thus the mapping $\varphi : Q_8 \rightarrow GL_2(\mathbb{C})$ is an injective homomorphism.