Suppose that $S$ is the set of all real $n\times n$ matrices $A$ such that $A^2=I_n$. Since these matrices are diagonalizable with $\pm 1$ as eigenvalues, we get the partition $S=\cup_{0\leq k \leq n} S_k$ where $S_k$ is the set of all matrices of the form $PJ_k P^{-1}$ where $P$ is a real invertible matrix and $J_k$ the diagonal $(1,\cdots,1,-1,\cdots,-1)$ (the first $k$ components are equal to $1$, and the other $n-k$ components are equal to $-1$).
My question is : are the $S_k$ the connected components of $S$ ? (and if yes, why ?) If not, what are the connected components of $S$?