Inverses -- Whether it is necessary to prove $AB=BA$ To prove that $B$ is the inverse of $A$, I recall from some other classes that it is necessary to show both $AB = BA$ and $AB = I$.
Yesterday, in my algebra class, I was totally stunned by my teacher as she said that it is not necessary to prove $AB=BA$ at all with the following proof:
Suppose $$AB = I$$
$$\det (AB) = \det I = 1$$
$$\det A \cdot \det B= 1$$
$$\det A \neq 0 \text{ and } \det B \neq 0$$  
$\implies A^{-1}$ exists.
Multiplying $A^{-1}$ from LHS on both sides,
$$A^{-1} \cdot A \cdot B = A^{-1} \cdot I$$
$$B = A^{-1}.$$
Therefore for any $AB = I$, $B$ is the inverse of $A$.

What is wrong with this proof?

 A: Nothing is wrong in the proof, since it is not necessary to prove $AB=BA$ 
Because $$AB=I \implies AB=BA$$
Let's see how,
Since $$AB=I \implies \det(A) \cdot \det (B) =\det (I)=1$$
$\implies \det(B) \neq 0 \implies $ $B$ has an inverse.
$$AB = I \implies BAB=B$$
(Pre-multiplying by $B$)
$BAB=B \implies BABB^{-1}=BB^{-1}=I $$
(Post-multiplying by $B^{-1}$)
$$BA=I=AB$$
A: The proof assumes that you already know that every square matrix $A$ with nonzero determinant has an inverse $A^{-1}$ that works from both sides.
Once you know this general fact, you can use the proof you quote to conclude that the $B$ you're looking at is in fact that inverse if only $AB=I$.
You would need more than this if you wanted to show general facts about inverses from first principles, but this is a perfectly good reasoning when you have particular matrices $A$ and $B$ that you're interested in.
A: In general, if we have an element $A$ of an unitary ring, then the fact that there is an element $B$ such that $AB=1$ doesn't imply that $BA=1$.
However, in this specific situation (square matrices) these assertions are equivalent, given a matrix $A$:


*

*there is a matrix $B$ such that $BA=\operatorname{Id}$;

*there is a matrix $B$ such that $AB=\operatorname{Id}$;

*$\det A\neq0$


and when they hold, the matrices $B$ from the first and the second assertions are unique and are the same.
