In the book of Linear Algebra by Greub, at page 229 question 4, it is asked that
Consider linear transformation $\phi$ of a real linear space $E$. Prove that an inner product can be introduced in $E$ such that $\phi$ becomes an orthogonal projection if and only if $\phi^2 = \phi$
We already know that if $\phi$ has n linearly independent eigenvector, we can define an inner product in $E$ s.t $\phi$ is self-adjoint.
To show $\phi^2 = \phi \Rightarrow \phi $ is orthogonal projection, first I need to know that $\phi$ has n linearly independent eigenvectors, but $\phi^2 = \phi$ only says that $\phi$ is stable under $Im \phi$, and does not say anything about the eigenvectors of $\phi$, so how can we prove this part ?
Just want to give a (relatively) easier explanation for my question:
Consider $\phi - i$.Since $$\phi (\phi - i) = \phi^2 - \phi = 0 $$
we have
$$(\phi -i)(v) \in Ker(\phi) \quad \forall v \in E.$$
Now, if we restrict $(\phi -i)$ to $Im (\phi)$, that is $$(\phi -i)(\phi(v)) = \phi^2 - \phi = 0,$$ so $$\phi (v) = i(v) \quad \forall v \in Im(\phi).$$
Moreover, we do now that, $$E = Ker (\phi) \oplus Im (\phi).$$ In fact, given $a \in E$, $$\phi (a) = b \in Im(\phi) \Rightarrow \phi^2 (a) = \phi(b) = \phi(a) \\ \Rightarrow \phi (b-a) \in Ker(\phi),$$ hence $\exists h \in Ker(\phi)$ s.t $$h = b-a \Rightarrow a = h + b$$, which proves the result.
Now, since $\phi|_{Ker(\phi)} = 0_E$ and $\phi|_{Im\phi} = i_E$, $\phi$ clearly has $n$ linearly independent eigenvectors corresponding to the eigenvalues $0$ and $1$.
Now, introduce an inner product in $E$ s.t these eigenvectos are orthogonal, and we are done.