If $A,B,C$ are $n \times n$ (real) matrices and $A$ and $B$ are invertible, with $AB=BC$, prove that $C$ is also invertible.
My attempted proof is $(B^{-1})(AB) = (B^{-1})(BC)$. Then $A(B^{-1})(B) = C$. So $A=C$ and $C$ is invertible.
I'm pretty sure the second line is not valid but am unsure how to fix the proof.
Hint:
You should have written have $B^{-1}AB = C$
So what is $(B^{-1}A^{-1}B)C $ or $C(B^{-1}A^{-1}B)$?