Problem
Let $V$ be a vector space over $\mathbb{C}$ and $T \in \mathscr{L}(V) $ such that $T = T^{-1}$.
Suppose $S = \{ W \in \mathscr{L}(V) \ |\ WT =TW \}$.
What is the dimension of $S$ (in terms of the dimension of $V$ and the trace of $T$)?
I know that $T$ is diagonalizable since $T^2-I = 0$ and the minimal polynomial of $T$ is $(\lambda+1)(\lambda-1)$, which has no repeated factors. Does this help solve the problem?
Your observation is indeed helpful. Up to a change of basis (i.e. up to matrix similarity), we may state that $T$ is the matrix $$ T = \pmatrix{I_{k_1}&0\\0 & -I_{k_2}} $$ Where $I_k$ denotes the $k \times k$ identity matrix, $k_1 = \dim \ker (T - I)$, and $k_2 = \dim \ker (T + I)$. Of course, $k_1 + k_2 = \dim V$.
Now, partition the matrix $W$ into blocks of the same size. We note that $W$ commutes with $T$ if and only if it has the form $$ W = \pmatrix{W_{11} & 0\\0 & W_{22}} $$ Conclude that $\dim(S) = k_1^2 + k_2^2$.