create your matrix and an equal sized identity matrix side by side. perform gaussian elimination on the matrix until you get it to an identity matrix. each time you perform any action, perform the same action on the identity matrix. When you have gotten the matrix into identity form, your identity matrix will now be the inverse matrix.