Doing some linear algebra exercises I found that:
Given $f \in \mathcal{End}(V)$ we define $f^\star$ an endomorphism such that, given $\phi$ a positive scalar product: $\phi(f(x),y)=\phi(x,f^\star(y))$.
Let $V$ a finite dimensional vector space, $\dim V=n$. Let $\phi$ a positive scalar product. Let $f \in \mathcal{End}(V)$ such that $$\sum\limits_{\lambda \in Sp(f)} m_\lambda=n,$$ where $m_\lambda$ is the algebraic multiplicity of the eigenvalue $\lambda$.
Prove that $$f=f^\star\iff\operatorname{trace}(ff^{\star})=\sum\limits_{\lambda \in Sp(f)} m_{\lambda}|\lambda|^2.$$
I did the $(\Rightarrow)$ using the spectral theorem and the diagonal form of $f$, but I can't handle the $(\Leftarrow)$, any suggestions?