Suppose $M \succ 0$ and we have some matrix $X$ such that rank($X'X) = r$. Then is rank($X'MX ) = r$, and can we relate the null spaces of $X'X$ and $X'MX$ in any way?
Since multiplication by an invertible matrix doesn't change the rank of the original matrix, I think the rank is preserved. But I can't seem to directly relate the null spaces, which was my initial attempt at proving this statement.
Hints.
Addition. Here's a simple reasoning proving equality of ranks. If $X$ is a diagonal matrix, the equality $\operatorname{rank}(X)=\operatorname{rank}(X'X)$ is obvious. Let $S$ be a non-singular matrix such that $XS$ is diagonal (you certainly know how to find $S$). We get $$ \operatorname{rank}(X'X) =\operatorname{rank}(S'X'XS) =\operatorname{rank}(XS)'(XS) =\operatorname{rank}(XS) =\operatorname{rank}(X). $$ In a similar way we can also prove $$ \operatorname{rank}(X)=\operatorname{rank}(X'MX) $$ provided that $M\succ0$.