Prove that $\ker(L)=\ker(L^2)$ Let $V$ be a finite dimensional vector space and let $L: V \rightarrow V$ be a linear transformation such that the rank of $L$ is the same as the rank of $L^2=L\circ L$.
How could i prove that $\ker(L)=\ker(L^2)$?
$\ker(L)=\{v\in V \mid L(v)=0\}$ and $\ker(L^2)=\{v\in V \mid L^2(v)=0\}$ 
So $L(v)=L^2(v)=0$ and obviously $v=v$ so i thought $ L^2=L$ and thus $\ker(L)=\ker(L^2)$, but I'm not sure if this is how it works.
 A: Obviously, $\ker(L)\subseteq\ker(L^2)$ and using rank-nullity theorem and your hypothesis, they have the same dimension. Whence the result.
Regarding your attempt, I do not understand how from $L(v)=L^2(v)$, you jump to $v=v$ and how this leads to $L^2=L$. First of all, we only know that $L(v)=L^2(v)$ holds for $v\in\ker(L)$ and $v=v$ tell us nothing. We can have $\ker(L)=\ker(L^2)$ without having $L=L^2$, in fact one has: $$\ker(L)=\ker(L^2)\Leftrightarrow\textrm{im}(L)\cap\ker(L)=\{0\}.$$
A: A linear map $L\colon V\to V$ can satisfy $\operatorname{rank}(L)=\operatorname{rank}(L^2)$ without being $L=L^2$: consider the map $L\colon\mathbb{R}^2\to\mathbb{R}^2$ given by
$$
v\mapsto\begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix}v
$$
so $L^2$ is the identity and $L\ne L^2$.
Clearly $\ker(L)\subseteq\ker(L^2)$, and the information about $V$ being finite dimensional is crucial. The rank-nullity theorem applied to $L$ and $L^2$ tells you
\begin{align}
\dim V
&=\dim\ker(L)+\operatorname{rank}(L)\\
&=\dim\ker(L^2)+\operatorname{rank}(L^2)
\end{align}

As a counterexample in infinite dimension, consider the vector space $\mathbb{R}[X]$ of polynomials with real coefficients. The derivative defines a surjective linear map $D\colon\mathbb{R}[X]\to\mathbb{R}[X]$, so also $D^2$ is surjective. However, the kernel of $D$ is different from the kernel of $D^2$, the former being the constant polynomials, the latter being the subspace of polynomials having degree at most one.
Therefore, the rank-nullity theorem is essential in the proof of the result you're after.
