To check whether $\mathrm{rank}(A)$ = $\mathrm{trace} (A)$ Let $A \in \mathrm{Mat}_{n\times n}(\mathbb C)$ with $A^2 = A$. Does it always imply that $\mathrm{rank}(A)$ = $\mathrm{trace}(A)$?

Yes: since it satisfies $A^2-A=0$, the polynomial $P(x)=x^2-x=x(x-1)$ satisfies $P(A)=0$. 
Hence the minimal polynomial $m_A(x)$ divides $P(x)$ and thus is a product of distinct linear 
factors and so $A$ is diagonalizable (here is the relevant theorem). 
Because the roots of $m_A(x)$ are the eigenvalues of $A$, and $m_A(x)|x(x-1)$, 
we know that all the eigenvalues of $A$ are just $t$ times $1$ and $s$ times $0$, 
where $s+t=n$ and one of them could be zero. Now you need to know that the rank as well as the 
trace do not depend on choice of basis, i.e. if $Q$ is an invertible matrix then 
$\operatorname{Trace}(A)=\operatorname{Trace}(Q^{-1}AQ)$ and $\operatorname{Rank}(A)=\operatorname{Rank}(Q^{-1}AQ)$.
Since in a diagonal matrix the rank is just the number of non-zero rows (or columns), in this case it will be
equal to the number of $1$'s. So $t=\operatorname{Trace}(A)=\operatorname{Rank}(A)$.
