If $A$ is an $n\times n$ square matrix such that $A^3=A$ , then show that $\operatorname{rank}(A) + \operatorname{tr}(A)$ is even.
$\mathbf {My \ attempt}:$ Actually, I have been trying over this problem which was posed as a multiple choice question in an exam . First of all to show that $\operatorname{rank}(A) ≥ \operatorname{tr}(A)$ . Consider, the rank factorization of $A$, $A= PQ$ where $P$ and $Q$ are $n\times r$ and $r \times n$ matrices respectively for $r=\operatorname{rank} (A$) , and as $P$ and $Q$ are left and right invertible, then $$\operatorname{tr}((QP)^2)=\operatorname{rank} A\geq \operatorname{tr}(QP)=\operatorname{tr}(PQ)=tr(A). $$ But, I can't approach for the part stated in the question . Any help is appreciated .