Suppose that $A$ and $B$ are real symmetric matrices and $A$ is invertible. Show that the matrix $A^{-1}B$ is diagonizable(similar to a diagonal matrix) if and only if there exists an invertible $P$ such that $P^{T}AP$ and $P^{T}BP$ are both diagonal matrices.
The 'if' part is straightforward; however the only if part seems quite hard. Can anyone help?

Hint: Notice that $(P^T A P)^{-1} \cdot P^T B P = P^{-1} A^{-1} B P$ is the product of two diagonal matrices.