Suppose $A, B$ are real $n \times n$ symmetric matrices and $A$ is also positive definite. Show that there exists a real invertible matrix $Q$ such that $Q^{t} A Q$ is equal to the identity matrix and $Q^{t} B Q$ is diagonal.
I know how to prove that there exists invertible $ Q$ such that $Q^{t} A Q$ is equal to the identity matrix, but need help on second part in a simple and concise manner.
Let's start from where you have stopped. Assume that you have found an invertible $S$ s.t. $S^tAS = I$. Observe that $S^tBS$ is a symmetric matrix. Therefore there exists an orthogonal matrix $P$ s.t. $P^t(S^tBS)P$ is diagonal. But at the same time $P^t(S^tAS)P = P^tIP = P^tP = I$. So, for $Q = SP$ we got $Q^tAQ = I$ and $Q^tBQ$ is diagonal.