Why is only a square matrix invertible?

Basically, an $\,n\times m\,$ matrix represents a linear map between linear spaces over some field of dimensions $\,m\,,\,n\,$ .

That a matrix is invertible means the map it represents is invertible, which means it is an isomorphism between linear spaces, and we know this is possible iff the linear spaces' dimensions are the same, and from here $\,n=m\,$ and the matrix is a square one.


A product of two matrices of order $m\times n$ and $n\times p$ is a matrix $m\times p$.

But when a matrix $A$ has an inverse $B$, it has a two sided inverse, that is $AB=BA=I$.

The only possibility is $m=n=p$.