I was searching about this question that if $\operatorname{rank}(A)=\operatorname{rank}(AB)$, then what can we say about $A$ and $B$? Under the current assumption, for all scalars $a$ and $b$ in $F$, if $a AB=bAB$, then $aA=bA$. I couldn't prove it and, worst of all, I couldn't find any serious result under the assumption $\operatorname{rank}(A)=\operatorname{rank}(B)$!
May the special case $F=\mathbb{R}$ work for the above problem?
The rank of a matrix is the dimension of it’s image. I’m assuming you’re dealing with finite dimensional spaces.
If $rank(A)=rank(AB)$, then, that means that when you restrict B to the image of A, its domain (of dimension rank(A)) has the same dimension as it’s image (of rank(AB)), so the restricted map has trivial kernel. This means that the kernel of B has trivial intersection with the range of A, so if x is in the image of $A$, then $xB=0$ implies $x=0$ Applying this to $x=(a-b)A$ which is in the range of A gives your desired result.