new to StackExchange, please correct me if I do something wrong..
Let $X$ be a matrix of the indefinite orthogonal group $\mathrm{O}(p,q)$, that is to say $X^T I_{p,q} X = I_{p,q}$ where $I_{p,q}$ is a diagonal matrix with $p$ ones followed by $q$ minus ones on its diagonal. Let $M$ be a diagonal matrix with $p+q$ distinct, positive entries on its diagonal, in decreasing order.
If $X^T M X = M$, then what can we say about $X$? In particular, must we have $X = I_{p,q}$?