Is there a simpler way to falsify this? I was told that there can't exist a matrix $M\in M_3(\mathbb R)$ such that $M^TCM$ and $M^TDM$ are both diagonal,where $$C=\begin{pmatrix}1&0&0\\0&-1&0\\ 0&0&0\end{pmatrix}$$ and $$D=\begin{pmatrix}0&1&0\\1&0&0\\0&0&0\end{pmatrix}.$$ Why is this necessarily true? Can this be shown without actually writing out $$M=\begin{pmatrix}a&b&c\\d&e&f\\g&h&i\end{pmatrix}$$ and dealing with messy algebra? I am quite sure there is a simpler way...
Added: where the resulting matrices are not the zero matrix
Thanks.
 A: The problem statement is false if $M$ is not constrained. As Jan pointed out, you may use $M=0$ as a counterexample.
When $M$ is invertible, however, the problem statement is indeed true. [Edit] The general theorem is this: if $A, B$ are real symmetric and $A$ is nonsingular, then they are simultaneously congruent to diagonal matrices if and only if $C=A^{-1}B$ is diagonalizable. See Horn and Johnson, Matrix Analysis, Theorem 4.5.15. For this particular question, however, we have a more elementary proof, which is given below.[End edit]
The main weapon for attacking the problem is Sylvester's law of inertia, which states that if $X$ is real symmetric and $M$ is invertible, then $X$ and $M^\top XM$ have the same number of positive, negative and zero eigenvalues.
Suppose $M^\top CM=\widehat{C}$ and $M^\top DM=\widehat{D}$ for some diagonal matrices $\widehat{C}$ and $\widehat{D}$. For any real number $\epsilon$, let $S_\epsilon=C+\epsilon D$. Then $\widehat{S}_\epsilon=M^\top SM$ is a diagonal matrix. Note that $C, D$ and $S_\epsilon$ all have exactly one positive eigenvalue, one negative eigenvalue and one zero eigenvalue. By Sylvester's law of inertia, So do $\widehat{C}, \widehat{D}$ and $\widehat{S}_\epsilon$. WLOG, assume the sign pattern of $\widehat{C}$ is $\widehat{C}=\textrm{diag}(+,-,0)$. Now there are two possibilities:


*

*The sign pattern of $\widehat{D}$ is $\textrm{diag}(0,+,-)$, $\textrm{diag}(0,-,+)$, $\textrm{diag}(+,0,-)$ or $\textrm{diag}(-,0,+)$. Then for sufficiently small $\epsilon\not=0$, $\widehat{C}+\epsilon\widehat{D}$ has three nonzero eigenvalues, which is a contradiction.

*The sign pattern of $\widehat{D}$ is $\textrm{diag}(+,-,0)$ or $\textrm{diag}(-,+,0)$. Therefore, for an appropriate value of $\epsilon$, the sign pattern of $\widehat{C}+\epsilon\widehat{D}$ would possess at least two zero eigenvalues. But this is again a contradiction. So we conclude that $C$ and $D$ cannot be simultaneously congruent to diagonal matrices.

A: There is a theorem that completely characterizes when two matrices are "simultaneously diagonalizable."  Have you looked it up?  It will give you a very easy test for checking whether or not $C$ and $D$ are simultaneously diagonalizable.
A: I will use only the left upper two by two block: We have the congruence relation 
$$
\pmatrix{1&0\\0&-1} = \left(\frac{1}{\sqrt{2}}\pmatrix{1&1\\1&-1} \right)\pmatrix{0&1\\1&0} \underbrace{\left(\pmatrix{1&1\\1&-1}\frac{1}{\sqrt{2}}\right)}_S
$$
Hence, you have to find a matrix $M$ such that it solves the following equation
$$
(SM)^T\pmatrix{0&1\\1&0}SM = M^T\pmatrix{0&1\\1&0} M
$$
Can you find one?
