The determinant can be calculated recursively, and the inverse can be calculated from the determinant. Hopefully the matrix in question will have integer entries, as floating point entries may have rounding inaccuracies.

See Wikipedia for both the determinant and inverse of a matrix. Both pages have examples.

The inverse of a (square matrix) is relatively easy to find.

Start with your matrix and an identity matrix of the same size.
Use matrix line operations (multiplication/addition of lines to other lines) to convert your matrix to the identity matrix.
Every operation you perform on your matrix also perform on the identity matrix.

Once you have transformed your matrix to the identity matrix the identity matrix will have been transformed to the inverse of your matrix.