If A is a real symmetric matrix congruent to $I_n$, show that all eigenvalues of A are positive.
This exercise induces me to use the Sylvester's Law of Inertia: https://en.wikipedia.org/wiki/Sylvester's_law_of_inertia. The fact that they are congruent implies that they have the same inertia. And since the inertia of $I_n$ has only positive eigenvalues, this induces that A have only positive eigenvalues. But i think that i could solve it in a different way. Here it is:
Consider: $x^tAx$. Since A is congruent to the identity matrix, there exists an invertible matrix P such that: $x^tAx=x^t(PIP^t)x = x^t(PP^t)x = (P^tx)^tP^tx= \langle P^tx, P^tx \rangle.$ Since $P^tx \neq0$ and$ \langle P^tx, P^tx \rangle \gt0 $, this shows that $x^tAx \gt0$. Hence, A is a positive-definite matrix and then all its eigenvalues are positive.
Is it correct?