Solution (source code)

= Solution

Let the columns of the given <unitary matrix> be $u_j$, with $Mu_j=\lambda_ju_j$. Columnwise, $MU=UD$ for $D=\operatorname{diag}(\lambda_1,\ldots,\lambda_n)$. Multiplication by $U^*$ and <unitarity> give
$$
\boxed{U^*MU=D.}
$$
The premise includes an <orthonormal eigenbasis>. It is not true that an arbitrary matrix admits such a basis; over $\mathbb C$ it exists precisely for a <normal matrix>. The real symmetric inertia matrix in part (b) does satisfy the required condition.