Answer
$A^{-1}=\left[\begin{array}{rr}
{1}&{-1/a}\\
{-1}& {2/a}\end{array}\right]$
Work Step by Step
To find the inverse of an $n$ by $n$ nonsingular matrix $A,$ proceed as follows:
STEP 1: Form the matrix $\left[A|I_{n}\right]$
STEP 2: Transform the matrix $\left[A|I_{n}\right]$ into reduced row echelon form.
STEP 3: The reduced row echelon form of $\left[A|I_{n}\right]$ will contain
the identity matrix $I_{n}$ on the left of the vertical bar;
the $n$ by $n$ matrix on the right of the vertical bar is the inverse of $A.$
If the identity matrix can not be obtained on the left, A has no inverse.
----
STEP 1
$\left[A|I_{n}\right] =\left[\begin{array}{ll|ll}{2}&{1}&{1}&{0}\\{a}&{a}&{0}&{1}\end{array}\right]\left(\begin{array}{l}
\div 2.\\
.
\end{array}\right)$
STEP 2
$\displaystyle \rightarrow\left[\begin{array}{cc|cc}{1}&{\displaystyle \frac{1}{2}}&{\displaystyle \frac{1}{2}}&{0}\\{a}&{a}&{0}&{1}\end{array}\right] \displaystyle \qquad \left(\begin{array}{l}
.\\
R_{2}=r_{2}-a\cdot r_{1}.
\end{array}\right)$
$\rightarrow\left[\begin{array}{cc|cc}
{1}&{\displaystyle \frac{1}{2}}&{\displaystyle \frac{1}{2}}&{0}\\
{0}&{\displaystyle \frac{1}{2}a}&{-\displaystyle \frac{1}{2}a}&{1}\end{array}\right] \displaystyle \qquad \left(\begin{array}{l}
.\\
\times\dfrac{2}{a}.
\end{array}\right)$
$\rightarrow\left[\begin{array}{cc|cc}
{1}&{\displaystyle \frac{1}{2}}&{\displaystyle \frac{1}{2}}&{0}\\
{0}&{1}&{-1}&{\displaystyle \frac{2}{a}}\end{array}\right]\qquad \left(\begin{array}{l}
R_{1}=r_{1}-\frac{1}{2}r_{2}.\\
.
\end{array}\right)$
$\rightarrow\left[\begin{array}{ll|ll}
{1}&{0}&{1}&{-\displaystyle \frac{1}{a}}\\
{0}&{1}&{-1}&{\displaystyle \frac{2}{a}}\end{array}\right]$
STEP 3
$A^{-1}=\left[\begin{array}{rr}
{1}&{-1/a}\\
{-1}& {2/a}\end{array}\right]$