= Solution
The two diagonal generators are independent involutions, so
$$
H_1=\{\operatorname{diag}(\epsilon_1,\epsilon_2):\epsilon_1,\epsilon_2\in\{1,-1\}\},\qquad |H_1|=4.
$$
It is a <Klein four-group>. Write the swapping generator as $J=\begin{pmatrix}0&1\\1&0\end{pmatrix}$. Then $J^2=I$, so $H_2=\{I,J\}$ has order two. Moreover,
$$
J\operatorname{diag}(\epsilon_1,\epsilon_2)J
=\operatorname{diag}(\epsilon_2,\epsilon_1)\in H_1.
$$
Thus $J$ normalizes $H_1$. The set
$$
K=\{DJ^\eta:D\in H_1,\ \eta\in\{0,1\}\}
$$
is a <group>: its products reduce using
$$
(DJ^\eta)(D'J^\zeta)=D(J^\eta D'J^{-\eta})J^{\eta+\zeta},
$$
and inverses reduce in the same way. It contains both generating <subgroups>, so minimality gives $G\subseteq K$; conversely every displayed product is in $G$, giving $G=K$.
There are four diagonal <matrices> $D$ and four off-diagonal <matrices> $DJ$, all distinct. Consequently
$$
\boxed{|G|=8}.
$$
Also $H_1\cap H_2=\{I\}$, since $J$ is not diagonal, and every element of $G$ has the form $DJ^\eta\in H_1H_2$. This proves condition (I), hence the <exact factorization of a group>. Here $H_1$ is a <normal subgroup> and $G=H_1\rtimes H_2$ is a <semidirect product>. Its <matrices> are the two-dimensional <signed permutation matrices>, also realizing the <dihedral group> of the square.
Back to article page