Matrix problem similar to Problem 3, SEEMOUS 2019 
Let $A, B\in M_n(\mathbb{C} ) $ such that $B^2=B$. Prove that $\operatorname{rank} (AB-BA) \le \operatorname{rank} (AB+BA) $. 

The problem above is the one that appeared in the SEEMOUS 2019, which is a contest for university students. In a contest for 11th graders in my country (here we study both linear algebra and real analysis in the 11th and the 12th grade), the same problem appeared, only that $A, B\in M_n(\mathbb{R})$. Now, I have seen solutions to the SEEMOUS problem which use pretty advanced techniques, which are not taught in high school here, but I want to find one that is appropriate for my level. I suppose there should be one since it appeared in that contest for 11th graders, yet I can't find one and there is also no official solution.
To sum up, I am looking for a solution to this which may only use basic rank inequalities, linear independence, diagonalization, block matrices and other things like these.       
EDIT: From $B^2=B$ I deduced that $B$ is diagonalizable and its eigenvalues are $0$ or $1$ (I doubt that eigenvalues help here).
If $B$ is invertible we have that $B=I_n$ and the conclusion follows.
In the other case, I think that we may use that $B$ is diagonalizable, but I don't know if this helps me express $AB$ and $BA$ somehow. 
 A: As $B^2=B$ so $B$ is diagonalizable. Now for $B=0$ or $B=I$, the result is trivial. So let us assume that $B\neq0,I$. Note that eigenvalues of $B$ can be only $0$ or $1$. Since $B$ is diagonalizable, we can write $B=UDU^{-1}$ where $D$ is the diagonal matrix with $1'$s at the first diagonal entries and $0'$s at the rest of them. Without loss of generality, assume that $$D=\begin{pmatrix}
I_r & 0 \\
0 & 0
\end{pmatrix}$$ where $I_r$ is the $r\times r$ identity matrix. Since rank is invariant under similar matrices, we have that $$\mbox{ rank }(AB-BA)=\mbox{ rank }\left(U^{-1}(AB-BA)U\right)=\mbox{ rank }(CD-DC)$$
and $$\mbox{ rank }(AB+BA)=\mbox{ rank }\left(U^{-1}(AB+BA)U\right)=\mbox{ rank }(CD+DC)$$ where $C=U^{-1}AU$. So it is enough to prove that $$\mbox{ rank }(CD-DC)\leq\mbox{ rank }(CD+DC)$$ Now let $$C=\begin{pmatrix}
P_{r\times r} & Q_{r\times n-r} \\
R_{n-r\times r} & S_{n-r\times n-r}
\end{pmatrix}$$ where the partition have been done conformally to $D$. Now $$CD-DC=\begin{pmatrix}
0 & -Q \\
R & 0
\end{pmatrix}$$ and $$CD+DC=\begin{pmatrix}
2P & Q \\
R & 0
\end{pmatrix}$$ From this, it follows that $$\mbox{ rank }(CD-DC)\leq\mbox{ rank }(CD+DC)$$
