Under what conditions are the eigenvalues of a product of two real symmetric matrices real? Under what conditions are the eigenvalues of a product $M = A B$ of two real symmetric matrices $A$ and $B$ real?
And is there a way to relate the signs of the eigenvalues of $M$ to any properties of $A$ and $B$?
 A: If $A$ (or $B$) is positive semidefinite, then $AB$ will have real eigenvalues, because then you can write $AB=A^{1/2}A^{1/2}B$ with real symmetric $A^{1/2}$, and this has the same eigenvalues as the symmetric matrix $A^{1/2}BA^{1/2}$.
Following up on Denis's edit, if $A$ is positive definite, the product $AB$ has the same number of positive and negative eigenvalues as $B$, as a consequence of Sylvester's law of inertia (applied to $SBS^\top$ with $S=A^{1/2}$).
Edit (by D. Serre). If indeed $A$ is positive definite, then the signs ($+,0$ or $-$) of the eigenvalues of $AB$ are the same as the signs of the eigenvalues of $B$. You may of course switch the roles of $A$ and $B$.
A: As Carlo wrote, a sufficient condition is that $A$ or $B$ is positive semidefinite.  I don't know if there is a useful necessary and sufficient condition.
Let's consider the case $$A = \pmatrix{1 & 0\cr 0 & -1\cr}, \ B = \pmatrix{b_{11} & b_{12} \cr b_{12} & b_{22}}$$
Then the condition is that the discriminant $(b_{11} + b_{22})^2 - 4 b_{12}^2$ of the characteristic polynomial of $AB$ is nonnegative, i.e. $(b_{11} + b_{22})^2 \ge 4 b_{12}^2$.
A: A slightly more general condition than those in the other answers is: if any linear combination $C = \alpha A + \beta B$ is positive semidefinite. This follows by the same argument on $(A,C)$ or $(B,C)$ + standard results on how eigenvalues change under sum/product/inversion.
I don't think this is also a necessary condition, unfortunately; I think counterexamples can be obtained with direct sums $A_1 \oplus A_2$, $B_1 \oplus B_2$.
A: Of course, we have a standard theorem that answers the question when $A$ or $B$ is definite ($>0$ or $<0$).
Unfortunately, when $spectrum(AB)$ is real, this assumption is rarely realized.
Indeed, if we randomly choose $A,B\in S_n$, then the probability that  $spectrum(AB)$ is real can be estimated as follows
for a sample of $1000$ couples $(A,B)$, an approximation of the frequence $f$ is
$n=4, f=152$; $n=5, f=48.5$; $n=6, f=19.5$; $n=7,f=2.5$; $n=8,f=2$.
Moreover, when $spectrum(AB)$ is real, in general, $A$ and $B$ are not definite. For example, during a test for $n=4$, there is only one couple $(A,B)$ s.t. $A$ or $B$ is definite among $166$ couples s.t. $AB$ has a real spectrum.
