Let $G=\{\left( \begin{array}{ccc}1 & b \\ 0 & a \\ \end{array} \right) : a,b \in \mathbb Z_7, a \neq 0\}$. Find the order of $G$. For each prime $p$ such that $p$ divides $|G|$, find all the elemens in $G$ that have order $p$.
I know that $G$ is a subset of the $2 \times 2$ matrices with coefficients in $\mathbb Z_7$. Is is pretty simple to construct an injective function from the set of such matrices and $\mathbb Z_7 \times \mathbb Z_7 \times \mathbb Z_7 \times \mathbb Z_7$, since the codomain is finite, then so is $G$. I have no idea how to find the cardinality of $G$ from here.
For the other part, if $A \in G$, then $|A|$ is the $n \in \mathbb N_0$ such that $nA=\left( \begin{array}{ccc}n & nb \\ 0 & na \\ \end{array} \right)= Id_2$. So, I need to find the minimum $n$ such that $$ n \equiv 1 (7),$$ $$nb \equiv 0 (7),$$ $$na \equiv 1 (7)$$
I am not so sure how to solve these equations. I would appreciate some help.
Note that there is an obvious bijection $G\to \Bbb Z_7\setminus\{0\}\times\Bbb Z_7$ (can you find it?). It follows that $$ |G|=|\Bbb Z_7\setminus\{0\}|\times|\Bbb Z_7|=6\times 7=42=2\times 3\times 7 $$ Thus the only primes dividing $|G|$ are $2$, $3$, and $7$.
For the second part of your question note that $$ A = \begin{pmatrix}1 & b\\ 0 & a\end{pmatrix} $$ satisfies $$ A^k= \begin{pmatrix} 1 & b\cdot\sum_{i=0}^{k-1}a^i \\ 0 & a^k \end{pmatrix} $$ Hopefully this is enough to get you started.