Solution (source code)

= Solution

Call the two proposed <matrices> $A$ and $B$. Direct multiplication gives $A^{2n}=I$, $B^2=\epsilon^nI=A^n$, and $B^{-1}AB=A^{-1}$. Both are invertible since $\epsilon\ne0$. They therefore satisfy every defining relation, and the <universal property of a group presentation> gives the desired <group representation>.