Let $f:V\rightarrow V$ be a linear transformation on a finite-dimensional vector space. If $f^2=f$, explain how to find a diagonal matrix representing $f$.
What I've done so far:
$f^2=f \Rightarrow f^2-f=0 \Rightarrow$ the minimal polynomial $m(x)$ divides $x(x-1)$ so $m(x)=x$ or $x-1$ or $x(x-1)$.
I'm not sure where to go from here. Can somebody please show me how to do the rest of the problem?
Show that $$V=\ker T\oplus \text{im} T$$ and $T$ fixes the image. So just take basis of the kernel and image.