The Properties of Matrices 
If $A$ and $B$ are a square matrix and $AB=I$ where $I$ is the identity matrix, show that $AB=BA$.
  I solve it, but does my solution correct ?

My Solution:
$$AB=I$$
 multiplying by $B$
$$BAB=BI$$
multiplying by $A$
$$BABA=BIA$$
by using the properties of matrices
$$(BA)(BA)=BA$$
from the last relation $BA=I$ so $$AB=BA$$
 A: (1) We can use statement $n\times n$  matrix $A$ is invertible if ${\rm det}(A)\not= 0$. We have:
$$1= {\rm det}(I) = {\rm det}(AB)= {\rm det}(A){\rm det}(B). $$
So ${\rm det}(A)\not= 0$, hence $A$ is invertible, that is, there is $A^{-1}$ such that $AA^{-1}=A^{-1}A=I$. But we note that: 
$$ B= IB= (A^{-1}A)B= A^{-1}(AB)=A^{-1}I= A^{-1}.$$
(2) Or we can use statement:  for $n\times n$  matrix $M$, if ${\rm rank}(M) =n$ then there is $n\times n$ matrix $N$ such that $MN=I$ (multiple Gaussian reduction). In our case, as $AB=I$, then ${\rm rank}(B) =n$ ($Bx=0$ implies $A(Bx)=0$ which implies $x=0$). So, there is $C$ such that $BC=I$. Finally, we note that: $$C=IC=(AB)C=A(BC)=AI=A.$$
A: In the last line of your solution I think you are assuming $AB=BA$, which is what you want to prove. Shouldn't your last line be $BA=BA$?
Here is an alternative solution to the others given. Since $AB$ is invertible, $A$ is invertible. To see this, denote left multiplication by $L$. We have that $L_{AB}=L_A\circ L_B$. Since $L_{AB}=I$ is invertible, it must be that $L_A$ is injective. But $L_A$ is a map between vector spaces of equal dimension. Hence $L_A$ is invertible so that by definition $A$ is invertible.
It follows $A^{-1}=A^{-1}I=A^{-1}AB=B$. That is $A^{-1}=B$.
A: One proof is:
consider $a:\Bbb R^n\to\Bbb R^n$ the linear application assiciated with the matrix $A$ (whose matrix with respect to the usual basis is $((1,0\dots 0), \dots ,(0\dots 0,1))$, and $b$ associated to $B$ the same way.
Then if $b(x) = 0$, $x  = a(b(x)) = 0$ because $AB = I \implies a\circ b = id$, so $b$ is into. A linear algebra theorem ensures that $b$ is bijective, and so as $a\circ b = id, b\circ a = id$ and then $BA = I = AB$.
