Work out the determinant: 3(2+1)-1(3+1)+2(3-2)=9-4+2=7.
Take each column and make it into a row:
3 3 1
1 2 1
2 -1 1
Replace each element with its subdeterminant:
(2×1-1×-1)=3 (1×1-1×2)=-1 (1×-1-2×2)=-5
(3×1-(-1)×1)=4 (3×1-1×2)=1 (3×-1-3×2)=-9
(3×1-1×2)=1 (3×1-1×1)=2 (3×2-3×1)=3
Change the sign of every other element and divide by the determinant:
( 3 1 -5)
(-4 1 9) ÷ 7
(1 -2 3)
Check the result by applying to the original matrix:
( 3 1 -5)(3 1 2)
(-4 1 9)(3 2 -1) ÷ 7
(1 -2 3)(1 1 1)=
(1 0 0)
(0 1 0)
(0 0 1)
The result is the identity matrix, so the inverse is correct.