Let $A$ and $B$ be square matrices of order $n$. Suppose that $\mathrm{rank}(A)=\mathrm{rank}(B)$ and $A^2B=A$. I am having difficulty trying to solve this problem during my practice:

Let $A$ and $B$ be square matrices of order $n$. Suppose that $\mathrm{rank}(A)=\mathrm{rank}(B)$ and $A^2B=A$. Prove the following:

*

*$ B $ and $ A^2 $ have the same nullspace 

*$ B^2A = B $

I am given the following hints:

For 1)
Use the fact that:
(i)  $\mathrm{rank}(AB) \le \min\{\mathrm{rank}(A),\mathrm{rank}(B)\}, A = (a_{ij})_{m \times n} $ and $ B = (b_{ij})_{n \times p} $ 
(ii) $\mathrm{rank}(A) + \mathrm{nullity}(A) = n$
to get a relation in $\mathrm{nullity}(B)$ and $\mathrm{nullity}(A^2)$. Then use the fact if $ U \subseteq V $ are vector spaces such that $\dim(U) = \dim(V) $, then $ U = V $.
For 2)
(i) Note that $ Bu = 0 \iff A^2u = 0 $ 
(ii) Prove that $(B^2A - B)x = 0 $ for all $ x \in \mathbb{R}^n $

For 1), my attempt:
$$ A^2B = A $$
$$ A^2Bx = 0 \iff Ax = 0, x \in \mathbb{R}^n $$
$$ Bx \in \mathrm{nullity}(A^2) $$
I am stuck here. My direction of thought seems wrong. But I really do not know what else to do.
For 2), my attempt:
$$ A^2x = 0, x \in \mathrm{nullity}(A^2), \mathrm{nullity}(B) $$
$$ Bx = 0, x \in \mathrm{nullity}(B), \mathrm{nullity}(A^2) $$
$$ B^2A = BBA = Bu \ \text{(Let }BA = u)$$
$$ \therefore Bu = 0 $$
$$ A^2u = 0 $$
$$ Bu - A^2u = 0 $$
$$ (B - A^2)u = 0 $$
I cannot seem how to get to my desired answer from here.
I spent hours trying to utilize the hints but to no avail. The final product of the proof seems too far from the given conditions. Could someone please advise me?

A hint for 1):
Observe a) $\dim\ker A=\dim\ker B$ by the rank-nullity theorem.
b) Since $A^2B=A$, we have $\ker B\subseteq \ker A$. Further, $\ker A\subseteq\ker A^2$, so $\ker B\subseteq\ker A^2$, and they have the same dimension…
