Let $A^2 = I$. Prove that $A = I$ if all eigenvalues of $A$ are $1$

Need help with this: Let $A^2 = I$, and all eigenvalues of $A$ are $1$. Prove that $A = I$. ($A$ is over the complexes)

I thought that because $A^2=I$, then $A$ is reversible and $A^{-1} = A$, and there are only two matrices that do this: the identity matrix and the zero matrix.
But it's only intuition and I couldn't prove that.


Solution 1:

We have $(A+I)(A-I)=0$. Since $-1$ is not an eigenvalue, $A+I$ is invertible and so $A-I=0$.

Solution 2:

If all the eigenvalues of $A$ are equal to 1, then its characteristic polynomial is $(-1)^n(x-1)^n$ and its minimal polynomial is of the form $(x-1)^m$, for some $m\le n$. Since the polynomial $p(x)=x^2-1$ annihilates $A,$ then then the minimal polynomial DIVIDES the polynomial $p$, and consequently the minimal polynomial of $A$ is $q(x)=x-1$.

Therefore, $A-I=0$.