Let $A$ be $m\times n$ and $B$ be $n\times m$ matrices, with $AB=I\_m$. I want to show $A,B$ have same rank.

---

First I know since $AB=I\_m$, $\operatorname{rank}(AB)=m$ and $\operatorname{nullity}(AB)=0$ and hence each nullity of $A,B$ are $0$ indicates $\operatorname{rank}(A)=n, \operatorname{rank}(B)=m$. Since $\operatorname{rank}(A) \leq \min\{m,n\}$, and the same thing holds for $B$, $m$ should be $n$ and hence $\operatorname{rank}(A)=\operatorname{rank}(B)$.

Is my trial correct? Is there any other ways to show this?

---

Sorry for the confusion; I notice your points. $\operatorname{nullity}(AB) \geq \operatorname{nullity}(B)$ is true for general matrix $A,B$ but
$\operatorname{nullity}(AB) \geq \operatorname{nullity}(A)$ holds for square matrix $A,B$. Before working on the formula directly, I should check the correct condition. Thanks for many comments!