I'm a first year computer science student and I have a question which goes like this: let A be a $n \times n$ matrix $(n \in \mathbb{N})$ such that $A^2 + I = 0$. Prove that $n$ is even.
Now, I came to a conclusion that a matrix of this form can work:
$$ A = \begin{pmatrix} 0 & 0 & \cdots & 0 &-1 \\ 0 & 0 &\cdots & 1 & 0 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 1 & 0 & \cdots & 0 & 0 \end{pmatrix} $$
(the degree of this matrix is even obviously) and of course I also tried a version with an odd degree which produced $I$ instead of $-I$. The question is how do I prove that?