A matrix is positive semidefinite (PSD) if it's symmetric and all its eigenvalues are non-negative. There are many other equivalent definitions.
Suppose $A$, $B$ are two PSD matrices. $AB$ is PSD if and only if $AB$ is symmetric. This is well-known.
This can be extended to the product of three PSD matrices: Is the product of $3$ positive semidefinite matrices positive semidefinite?
However, it fails for products of four matrices and greater: If the product of $n$ positive definite matrices is symmetric, is it also positive definite?
Suppose I have $n$ PSD matrices $A_1, A_2, \dots, A_n$ and suppose the product $A_1 A_2 \dotsb A_n$ is symmetric. Is there any non-trivial condition on the $A_i$ or on the product that guarantees that the product is PSD?
One sufficient condition (along with the condition that $A_1A_2\cdots A_n$ is Hermitian), generalised from a proof for the case $n=3$, is that $B=A_2A_3\cdots A_n$ is a diagonalisable matrix over $\mathbb C$ with a real nonnegative spectrum. This condition is also necessary when $A_1$ is positive definite.
Given this sufficient condition, $B$ has a matrix square root that can be expressed as $g(B)$ for some polynomial $g$. Now, since $A_1A_2\cdots A_n$ is supposed to be Hermitian, we have $A_1B=B^\ast A_1$. So, inductively, we have $A_1B^k=(B^k)^\ast A_1$ for all nonnegative integer $k$. Hence $A_1g(B)=g(B)^\ast A_1$. Consequently, $A_1A_2\cdots A_n=A_1B=A_1g(B)^2=g(B)^\ast A_1g(B)$ is PSD.