Show that Rank $(A)$ = Rank$(A^2)$ $\iff \exists$ B invertible s.t. $A^2= B A$. Given $n \times n$ matrix $A$, not necessarily invertible, what invertible matrix $B$ solves $A^2= B A$?
$B$ should be $A$ but that is what not being said in the claim above. Please help. Thanks in advance.

We have yet to see that the converse is true, so here is a bit about that.
Consider an $n \times n$ matrix over the field $k.$ Given an invertible matrix $B$ such that $A^2 = BA,$ we claim that $\ker(A^2) = \ker(BA) = \ker(A).$ Certainly, we have that $\ker(A) \subseteq \ker(A^2),$ as any vector $v$ such that $Av = 0$ gives $A^2 v = A(Av) = A(0) = 0.$ Conversely, for $v \in \ker(A^2) = \ker(BA),$ then we have that $0 = (BA)v = B(Av)$ so that $Av$ is in $\ker(B).$ But as $B$ is invertible, we must have that $Av = 0$ so that $v \in \ker(A).$ By the Rank-Nullity Theorem, we have that $$\operatorname{rank}(A^2) + \operatorname{nullity}(A^2) = n^2 = \operatorname{rank}(A) + \operatorname{nullity}(A),$$ but in view of the fact that $\ker(A^2) = \ker(A),$ we find that $\operatorname{rank}(A^2) = \operatorname{rank}(A).$
