If A is a square matrix of size n with real entries, with $A = A^{p+1}$, then $rank(A) + rank (I_n - A^p) = n$ Let A be a square matrix of size n with real entries, $n \geq 2$,  with $A = A^{p+1}$, $p \geq 2 $, then $$rank(A) + rank (I_n - A^p) = n$$
If p is prime, in addition, $$rank (I_n - A)=rank (I_n - A^2)=rank (I_n - A^3)=...=rank (I_n - A^{p-1})$$ 
I've tried using Sylvester: $rank(A) + rank (I_n - A^p) \leq n$, since $rank(A(I_n - A^p))=0$. I am guessing the next step is using Frobenius and obtaining something that looks like $rank(A) + rank (I_n - A^p) \geq n$. Since $A$ contains real entries, $det(A)=0 $ or $det(A)=1$.
Factoring $(I_n - A^p)=(I_n - A)(I_n + A + A^2 + .... + A^{p-1})$ might be of help. Also, if you know a course or book which contains more problems like these, I would love it if you suggest me a material which contains exercises alike.
 A: You have 
\begin{align}
n&=\operatorname{rank}(I)=\operatorname{rank}(A^p+I-A^p)\leq \operatorname{rank}(A^p)+\operatorname{rank}(I-A^p)\\ \ \\ &\leq \operatorname{rank}(A)+\operatorname{rank}(I-A^p). 
\end{align}
When $p=2$, the chain of equalities is trivial. 
For $p\geq3$ you can analize the problem by looking at the Jordan form and noticing that $A=A^{p+1}$ forces $A$ to be diagonalizable (over $\mathbb C$). Since $A(I-A^p)=0$, the eigenvalues of $A$ are either $0$ or $p^{\rm th}$-roots of unity. 
If $p\geq3$ and $p$ is prime, it is in particular odd. So $p\pm1$ is even. Then  the equality $A=A^{p+1}$ tells us that $-1$ cannot be an eigenvalue for $A$. This guarantees that the eigenvalue $1$ has the same multiplicity in $A^m$ for all $m\leq p-1$ (as no new ones will appear from even powers of $-1$). Moreover, because $p$ is prime the eigenvalues which are not $1$ (but are $p$-roots of unity) cannot have $\lambda^m=1$. So when we calculate $I-A^m$ the eigenvalues are $1-\lambda ^m$ for $\lambda$ eigenvalue of $A$; so the same number of $1$ will turn to zero for all $m$. Thus
$$
\operatorname{rank}(I-A^m)=\operatorname{rank}(I-A^{m-1}),\ \ \ m\leq p-1.
$$
for all $m$
