Is $A$ invertible if $ABAB^2 = I$? 
Q: Have two matrices of order $5$, $A$ and $B$. If $ABAB^2 = I$, is $A$ invertible? A: Yes, the inverse of $A$ would be $BAB^2$


My definition of an inverse matrix is:
For some matrix $X$, its inverse $X^{-1}$ (if it exists) is one such that
$$XX^{-1} = X^{-1}X = I$$
In that case, looking at the question above, there's something that I don't quite get:
Since $ABAB^2 = I$, we know that $A(BAB^2) = I$, which means that $(BAB^2)$ is the inverse of $A$ from the right.
However, don't we also have to prove that it is from the left as well since matrix product is NOT commutative? That is, $(BAB^2)A = I$? Otherwise, $(BAB^2)$ would not necessarily be $A$'s inverse.
A: There is a theorem that says that if $D$ and $E$ are two square matrices of the same size such that $DE = I$, then automatically $ED = I$. Thus an inverse on the right is always an inverse.
This is a major theorem in linear algebra, that will usually be taught in any introductory class. For the reasons you mentioned (non-commutativity), it is not initially clear why it should be true.
A: This is indeed an important observation. However, there is a theorem which states that for every two square matrices of the same dimension, $A,B$, if $AB=I$ then also $BA=I$.
