Consider two positive semi-definite, symmetric matrices $A, B$ in $\mathbb{R}^{p \times p}$. I wonder how to prove $tr(AB) \leq \max\{ tr(A^2), tr(B^2) \}$. I did some simulations and it looks like $tr(AB) \leq \max\{ tr(A^2), tr(B^2) \}$ might be true, but I have trouble proving it.
I tried using the inequality $\lambda_{i+j-1}(AB) \leq \lambda_i(A) \lambda_j(B)$ for $1 \leq i, j \leq p$ such that $i + j \leq 1 + p$, where $\lambda_j(A)$ is the j-th largest eigenvalue of $A$, but it only gives $\lambda_j(AB) \leq \min\{\lambda_1(A) \lambda_j(B), \lambda_j(A) \lambda_1(B)\}$, not in terms of $\lambda_j^2(A)$ or $\lambda_j^2(B)$, which are directly related to $tr(A^2), tr(B^2)$.
Any help is greatly appreciated!