Hi
Let
$$
M:=\left\{\left(\begin{array}{ll}
a & b \\
0 & c
\end{array}\right) \mid a, b, c \in \mathbb{Z}\right\} .
$$
$$M$$ is a non-commutative monoid under matrix multiplication. The element $$\left(\begin{array}{ll}a & b \\ 0 & c\end{array}\right)$$ has an inverse if and only if $$a, c \in\{\pm 1\}$$. In this case, one has
$$
\left(\begin{array}{ll}
a & b \\
0 & c
\end{array}\right)^{-1}=\left(\begin{array}{cc}
a & -a b c \\
0 & c
\end{array}\right)
$$
(Verify!)
Hace you tried something?
Since the matrix product is associative with identity element the indentity matrix, it's sufficiente to check that the multiplication restricts to \( M \). But:
\( \begin{pmatrix}a&b\\0&c\\\end{pmatrix}\begin{pmatrix}a'&b'\\0&c'\\\end{pmatrix}=\begin{pmatrix}aa'&ab'+bc'\\0&cc'\\\end{pmatrix} \)
Moreover, if \( \begin{pmatrix}a&b\\0&c\\\end{pmatrix} \) has inverse \( \begin{pmatrix}a'&b'\\0&c'\\\end{pmatrix} \) then:
\( \begin{pmatrix}aa'&ab'+bc'\\0&cc'\\\end{pmatrix}=\begin{pmatrix}1'&0\\0&1\\\end{pmatrix} \)
From this \( aa'=1 \) and \( cc'=1 \). But \( a,a',c,c' \) are integers so \( a'=a=\pm 1 \), \( c'=c=\pm 1 \) and:
\( ab'+bc'=0\quad \Rightarrow \quad ab'+bc=0 \quad \Rightarrow \quad ab'=-bc \quad \Rightarrow \quad aab'=-abc \quad \Rightarrow \quad b'=-abc \)
Complete details. Ask your doubts.
Best regards.