Artificial intelligent assistant

Orthogonal projection on the image of a linear operator Let $f: \mathbb{R}^n \to \mathbb{R}^n$ be a linear operator whose corresponding matrix $A$ (with respect the canonic bases in both the domain and the codomain) is symmetric. I have to show that $f$ is the orthogonal projection on $Im(f)$ if and only if $A^2=A$. Can you help me?

**Hint** : If $A^2=A$ then $A(A-1) \in I(A)$ so the matrix is diagonalizable with eigenvalues $0,1$. Let's now represent this diagonalized matrix:

$$J=\begin{pmatrix} 1 \\\ &\ddots \\\ &&1 \\\ &&&0 \\\ &&&&\ddots \\\&&&&&0\end{pmatrix}$$

What does this matrix to your vector when you do $J(v), v\in V$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7ab0156d340927a7e57cf18f58ddf6c4