A question about linear operators

Here is an outline of the proof:
1) Prove that if $S^2=S$ then for any $v\in {\rm{Im}}(S)$ you have $Sv=v$.
2) Assume that $S\neq 0$. Then you can find $v\neq 0$ such that $Sv=v$.
3) Assume that $S\neq Id$. Then you can find $w\neq 0$ such that $Sw=0$.
4) If $S\neq 0$ and $S\neq Id$, denote $B=(v,w)$ from the previous steps. $B$ is a basis for $\mathbb{R}^2$ (why?). Now compute $[S]_B$ (the matrix of $S$ represented w.r.t the basis $B$). You should get $A$ :)


Hint: You can distinguish three cases according as the dimension of the image of $S$ is $0$, $1$ or $2$.