Matrix Inversion in the complexity class $P$ seen as a decision problem
Gaussian elimination is an algorithm, you can’t frame it as a problem and thus it can’t be in $P$.

But matrix inversion itself is a problem and its decision version is as follows: “does matrix $M$ have an inverse?”

Gaussian elimination then is one possible way to prove that you can always answer that question in polynomial time, therefore matrix inversion is in $P$.