An inverse is unique. If $B$ and $C$ both invert $A$, then $B=B(AC)=(BA)C=C$. Thus the notation $A^{-1}$ is unambiguous. The proof uses associativity, not commutativity.