Solution (source code)

= Solution

The <general linear group> $GL_2(\mathbb F_5)$ consists of invertible two-by-two matrices over the <finite field> $\mathbb F_5$, under <matrix multiplication>. Such a matrix has two <linearly independent> columns. There are $5^2-1=24$ choices for a nonzero first column, and $5^2-5=20$ choices for a second column outside its one-dimensional span. Thus
$$
\boxed{|GL_2(\mathbb F_5)|=24\cdot20=480.}
$$
The <determinant> is a <group homomorphism>
$$
\det:GL_2(\mathbb F_5)\longrightarrow\mathbb F_5^\times,
$$
where $\mathbb F_5^\times=\{1,2,3,4\}$ is the multiplicative <group> of nonzero field elements. It is surjective because $\operatorname{diag}(t,1)$ has <determinant> $t$. Its <kernel of a group homomorphism> is $SL_2(\mathbb F_5)$. The <first isomorphism theorem> gives a quotient of order four, whence
$$
\boxed{|SL_2(\mathbb F_5)|=480/4=120.}
$$
The nonzero squares form the <subgroup> $\{1,4\}$ of $\mathbb F_5^\times$. Its inverse image
$$
\boxed{H=\{M\in GL_2(\mathbb F_5):\det M\in\{1,4\}\}}
$$
is a <subgroup> with index two. Indeed, composing the <determinant> with the quotient map to $\mathbb F_5^\times/\{1,4\}$ makes $H$ the kernel of a surjective <group homomorphism> to a group of order two. Thus $|H|=240$.