If $A^2 = I$, then $\operatorname{rank} (A+I) + \operatorname{rank} (A-I) =n$ 
Let $A ∈ M_n$. If $A^2 = I$, 
  show that
  $$\operatorname{rank} (A + I) + \operatorname{rank} (A − I) = n$$

I know that $x^2=1$, $x^2-1=0$, and so $(x-1)(x+1)=0$.
So  depending on this formula, how I can complete my solution to this question 
 or how can I use  anther methods to solve it. Any one could help me please?
 A: This is not true if the ground field $ K $ is not assumed to have characteristic $ \neq 2 $. Indeed, it already fails for $ A = I $.
Hint: If $ K $ is assumed to have characteristic $ \neq 2 $, then any matrix $ A $ such that $ A^2 = I $ is diagonalizable, so you may assume without loss of generality that $ A $ is diagonal. Do you see how to prove the assertion in this case?
A: You know that $0=A^2-I = (A+I)(A-I)=(A-I)(A+I)$ (which follows from the same calculation that gives $x^2-1=(x-1)(x+1)$).
This means that $(A+I)(A-I)u=0$ which means that the range of $(A-I)$ is contained in the nullspace of $(A+1)$ and vice versa. This means that
$$n - \dim V(A-I) \ge \dim V(A+I)$$
or 
$$\dim V(A+I) + \dim V(A-I) \le n$$
You also have that if $(A+I)u = 0$ then $(A-I)u = (A+I)u-2u\ne 0$ for non-zero $u$. which means that the null-spaces of $A+I$ and $A-I$ don't overlap. Which means that
$$\dim N(A+I)+\dim N(A-I) \le n$$
or
$$2n - \dim V(A+I) - \dim V(A-I) \le n$$
$$\dim V(A+I) + \dim V(A-I) \ge n$$
So
$$n \le \dim V(A+I) + \dim V(A-I) \le n$$

As pointed out in other answers this doesn't hold if the characteristic of the underlying field is $2$ if that means anything to you. This assumption is in fact used in $(A+I)u-2u = -2u \ne 0$ which fails if the characteristic is $2$ in which case in fact $-2u = 0$ so the null spaces may overlap. In that case we can only say that the $\dim V(A+I)+\dim V(A-I)\le n$.
A: Let us first show that if $f\circ f=id$ then we can write the space as sum of fixed-points and antipodal points.
Observation. Let $V$ be a vector space (over a field $K$ such that $\operatorname{char}(K)\ne 2$). If $f\colon V\to V$ is a linear map such that $f\circ f=id_V$ then we have $V=V_1\oplus V_2$ where
\begin{align*}
V_1 &= \{x\in V; f(x)=x\}\\
V_2 &= \{x\in V; f(x)=-x\}
\end{align*}
Proof. It is immediately clear that $V_1\cap V_2=\{0\}$. 
Now for any $x\in V$ we can define 
\begin{align*}
    x_1&=\frac{x+f(x)}2;\\
    x_2&=\frac{x-f(x)}2.
\end{align*}
We see that $x=x_1+x_2$. Using $f(f(x))=x$ and linearity of $f$ it is easy to check that $f(x_1)=x_1$ and $f(x_2)=-x_2$. So we have $x_1\in V_1$ and $x_2\in V_2$.
Since we have shown that every vector from $V$ can be written in this way, we get $V=V_1+V_2$. Together with the fact that these two subspaces have trivial intersection, we have $V=V_1\oplus V_2$.

Now to obtain the claim from the question it suffices to notice that if $f$ is the linear function corresponding to the matrix $A$, then $A^2=I$ means that $f\circ f=id$. And now all that remains is to check how $\dim V_1$ and $\dim V_2$ are related to the ranks of the matrices $A\pm I$.
A: HINT:
We have the equality
$$\frac{I-A}{2}+ \frac{I+A}{2} = I\\
\frac{I-A}{2} \cdot \frac{I+A}{2} = 0$$ so $I$ is a sum of two projections (with product $0$). 
Assuming the characteristic is $\ne 2$. In char $2$ we have the counterexample $A=\left(\begin{matrix}1&1\\0&1\end{matrix}\right)$ .
A: Here is the proof for 
$$\boxed{A^2=I\Leftrightarrow\operatorname{rank}(A+I)+\operatorname{rank}(A-I)=n}$$
One one hand ( to prove"$\Rightarrow$"), since $$\operatorname{rank}(A+I)+\operatorname{rank}(A-I)\geq\operatorname{rank}(2I)=n$$
and $$(A-I)(A+I)=I\Rightarrow\operatorname{rank}(A+I)\leq n-\operatorname{rank}(A-I)$$
We deduce that $\operatorname{rank}(A+I)+\operatorname{rank}(A-I)=n$
$$$$On the other hand ( to prove "$\Leftarrow$"), since $$\ker (A+I)+\ker(A-I)=n$$, we deduce that $A$ is diagnolizable, and the eigenvalues of $A$ must be $1$ or $-1$,i.e. $$ A\sim P^{-1}\Lambda P$$ ,where $P$ is reversible and $\Lambda$ is a diagonal matrix with elements either $1$ or $-1$.
$$$$We deduce that $A^2=P^{-1}\Lambda PP^{-1}\Lambda P=P^{-1}\Lambda^2 P=I$.
