Suppose that $n\geq 2$ and that $A,B\in M_n(\mathbb{R})$ are such that $A^2=-I_n$ and $AB=BA$. Can we infer that $\det{B}\geq0$?
My attempt:
Since $A^2=-I_n$, we have $A^{-1}=-A$ and $\det{A}=\pm1$. Also, we can deduce that:
$$\begin{align*}
\det{A^{-1}}&=(-1)^n\det{A}\\
\frac{1}{\det{A}}&=(-1)^n\det{A}\\
1&=(-1)^n(\det{A})^2
\end{align*}$$
This implies that $n$ must be even. However, I am stuck at this point. I tried to use the characteristic polynomial and show that $B$ is diagonalizable over $\mathbb{C}$. But I could not succeed. Any help would be greatly appreciated.