$$ \color{magenta}{
\left(%
\begin{array}{cr}
\cos\left(X\right) & \sin\left(X\right)
\\
\sin\left(X\right) & -\cos\left(X\right)
\end{array}\right)}
$$
really does square to give the identity.
For an $n$ by $n$ matrix with real entries, call it $A,$ if $A$ is symmetric and $A^2 = I$ and $\operatorname{trace} A = n-2,$ then $A$ is a reflection. This applies to the example above with $n=2.$ The eigenvalues are, indeed, $-1,1.$
If we have real numbers $\alpha, \beta, \gamma$ such that
$$ \color{blue}{ \alpha^2 + \beta^2 + \gamma^2 = 1 }, $$ then
$$ \color{green}{
\left(
\begin{array}{ccc}
1 - 2 \alpha^2 & - 2 \alpha \beta & -2 \alpha \gamma \\
- 2 \alpha \beta & 1 - 2 \beta^2 & - 2 \beta \gamma \\
-2 \alpha \gamma & - 2 \beta \gamma & 1 - 2 \gamma^2
\end{array}\right)}
$$
is a reflection. It negates the vector with entries $(\alpha, \beta, \gamma)$ and fixes vectors orthogonal to that, such as $(\beta, -\alpha, 0)$ and $(\alpha \gamma, \beta \gamma, \gamma^2 - 1).$ So the eigenvalues are $-1,1,1$ and the trace is $1 = 3-2.$
Oh, if you simply negate all the entries in the 3 by 3 matrix, what you get fixes $(\alpha, \beta, \gamma)$ and rotates in the orthogonal plane by $180^\circ$
Given a column vector $v$ with transpose $v^T$ a row vector, we know that $v^T v$ is the 1 by 1 matrix whose only entry is $v \cdot v = |v|^2.$ In contrast, $v v^T$ is a symmetric $n$ by $n$ matrix of rank $1.$ If, in addition, $|v| = 1,$ then the matrix of the reflection in $v$ is
$$ \color{magenta}{ I - 2 v v^T}. $$ So, given any $w$ orthogonal to $v,$ we get $v^T w = ( v \cdot w) = (0);$ so $$(I - 2 v v^T) w = Iw - 2 v (v^T w) = w - 2 v (0) = w.$$ But $$(I - 2 v v^T) v = Iv - 2 v (v^T v) = v - 2 v (1) = -v.$$ Meanwhile,
$$(I - 2 v v^T)^2 = I - 4 v v^T + 4 v v^T v v^T = I - 4 v v^T + 4 v (v^T v) v^T = I.$$
If $ a^2 + b^2 + c^2 + d^2 + e^2 + f^2 + g^2 + h^2 = 1, $ the reflection that negates $(a,b,c,d,e,f,g,h)$ is
$$
\color{magenta}{\left(
\begin{array}{cccccccc}
1 - 2 a^2 & -2ab & -2ac & -2ad & -2ae & -2af & -2ag & -2ah \\
-2ab & 1-2b^2 & -2bc & -2bd & -2be & -2bf & -2bg & -2bh \\
-2ac & -2bc & 1-2c^2 & -2cd & -2ce & -2cf & -2cg & -2ch \\
-2ad & -2bd & -2cd & 1-2d^2 & -2de & -2df & -2dg & -2dh \\
-2ae & -2be & -2ce & -2de & 1-2e^2 & -2ef & -2eg & -2eh \\
-2af & -2bf & -2cf & -2df & -2ef & 1-2f^2 & -2fg & -2fh \\
-2ag & -2bg & -2cg & -2dg & -2eg & -2fg & 1-2g^2 & -2gh \\
-2ah & -2bh & -2ch & -2dh & -2eh & -2fh & -2gh & 1-2h^2
\end{array}\right)}
$$
with trace 6.