Relation between trace and rank for projection matrices
Easy to show (for example, from Jordan normal form): $\lambda_k^2 = \lambda_k$, i.e., $\lambda_k \in \{0, 1\}$ are the eigenvalues of $A$. The trace is the sum of all eigenvalues and the rank is the number of non-zero eigenvalues, which - in this case - is the same thing.
Yes it's true. Notice that $A$ is diagonalizable since the polynomial with simple roots $x^2-x$ annihilates it and the eigenvalues of $A$ belong to the set $\{0,1\}$ so $A$ is similar to $\operatorname{diag}(\underbrace{1,\ldots,1}_{r\;\text{times}},0,\ldots,0)$ hence we see that
$$\operatorname{rank}(A)=r=\operatorname{trace}(A)$$
First, we note that $\;A^2=A\iff A(A-I)=0\;$ , so the matrix is a root of $\;x(x-1)\;$ .
Thus the minimal polynomial of $\;A\;$ divides the above polynomial, which means the only eigenvalues of $\;A\;$ are zero or one , and we already know the matrix is diagonalizable (why?)
If we now pass to the Jordan Normal Form $\;J_A\;$ of $\;A\;$ (i.e., in this case the diagonal form of the matrix) , we see that we'll get as many $\;1$ 's on the diagonal as the rank of the matrix, because $\operatorname{rank} J_A = \operatorname{rank} A$ , and thus we have that $$\operatorname{Tr} A= \operatorname{Tr} J_A= \operatorname{rank} A$$