Let $R$ be a unitary commutative semi-ring and let $M_n(R)$ be the semi-ring of $n \times n$ matrices with coefficients in $R$. Let's call $I$ the identity matrix in $M_n(R)$ (it exists because $R$ is unitary).
Is it true that for any $A$ and $B$ in $M_n(R)$ such that $AB=I$ we have $BA=I$?
This is proven in Inversion of Matrices over a Commutative Semiring by Reutenauer and Straubing. The proofs aren't especially short though (as you request in the comments). The first two paragraphs give good context for their paper though:
It's worth mentioning that "semi-ring" for them requires having a multiplicative identity, so they do prove the result you desire.