1. Write the augmented matrix by appending the identity matrix:
\left( \begin{array}{ccc|ccc}2 & -1 & 0 & 1 & 0 & 0 \\1 & 3 & 2 & 0 & 1 & 0 \\4 & 0 & 1 & 0 & 0 & 1\end{array} \right)
2. Convert the first row to have a leading 1 by multiplying by \frac{1}{2}:
\left( \begin{array}{ccc|ccc}1 & -\frac{1}{2} & 0 & \frac{1}{2} & 0 & 0 \\1 & 3 & 2 & 0 & 1 & 0 \\4 & 0 & 1 & 0 & 0 & 1\end{array} \right)
3. Eliminate the first column entries below the leading 1 in the first row:
Subtract row 1 from row 2: R2 \rightarrow R2 - R1
Subtract 4 times row 1 from row 3: R3 \rightarrow R3 - 4R1
\left( \begin{array}{ccc|ccc}1 & -\frac{1}{2} & 0 & \frac{1}{2} & 0 & 0 \\0 & \frac{7}{2} & 2 & -\frac{1}{2} & 1 & 0 \\0 & 2 & 1 & -2 & 0 & 1\end{array} \right)
4. Convert the second row second element to 1 by multiplying by \frac{2}{7}:
\left( \begin{array}{ccc|ccc}1 & -\frac{1}{2} & 0 & \frac{1}{2} & 0 & 0 \\0 & 1 & \frac{4}{7} & -\frac{1}{7} & \frac{2}{7} & 0 \\0 & 2 & 1 & -2 & 0 & 1\end{array} \right)
5. Eliminate the second column entries above and below the leading 1 in the second row:
Add \frac{1}{2} times row 2 to row 1: R1 \rightarrow R1 + \frac{1}{2}R2
Subtract 2 times row 2 from row 3: R3 \rightarrow R3 - 2R2
\left( \begin{array}{ccc|ccc}1 & 0 & \frac{2}{7} & \frac{3}{7} & \frac{1}{7} & 0 \\0 & 1 & \frac{4}{7} & -\frac{1}{7} & \frac{2}{7} & 0 \\0 & 0 & \frac{-1}{7} & -\frac{12}{7} & -\frac{4}{7} & 1\end{array} \right)
6. Convert the third row third element to 1 by multiplying by -7:
\left( \begin{array}{ccc|ccc}1 & 0 & \frac{2}{7} & \frac{3}{7} & \frac{1}{7} & 0 \\0 & 1 & \frac{4}{7} & -\frac{1}{7} & \frac{2}{7} & 0 \\0 & 0 & 1 & \frac{12}{7} & \frac{4}{7} & -7\end{array} \right)
7. Eliminate the third column entries above the leading 1 in the third row:
Subtract \frac{2}{7} times row 3 from row 1: R1 \rightarrow R1 - \frac{2}{7}R3
Subtract \frac{4}{7} times row 3 from row 2: R2 \rightarrow R2 - \frac{4}{7}R3
\left( \begin{array}{ccc|ccc}1 & 0 & 0 & \frac{2}{7} & \frac{1}{7} & 2 \\0 & 1 & 0 & -\frac{2}{7} & \frac{2}{7} & 1 \\0 & 0 & 1 & \frac{12}{7} & \frac{4}{7} & -7\end{array} \right)
Thus, the inverse of the given matrix is:
\begin{pmatrix}\frac{2}{7} & \frac{1}{7} & 2 \\-\frac{2}{7} & \frac{2}{7} & 1 \\\frac{12}{7} & \frac{4}{7} & -7\end{pmatrix}