If $A$ is a square matrix and there exists a square matrix $B$ such that $AB =1$, than it is known that $BA=1$. This property is proved with some properties from linear algebra. Although I've never seen it be proved just by structures of matrix multiplication, I couldn't find a counterexample of a set with structures of matrix multiplication but left inverse doesn't imply right inverse.
To be more specific, let $X$ be a set and binary operation $\cdot$ is defined on $X$. If $\cdot$ is associative and $X$ has left and right identity(which will be the same), than does $A \cdot B = 1$ for some $A, B\in X$ implies $B \cdot A = 1$?
If not, what other properties of matrix multiplication should we add to this structure of $(X,\cdot)$ in order to get the property?