# How to prove this property for a nilpotent map on a vector space

Let $X$ vector space over $\mathbb{R}$ with $\dim(X)=3$. and let $T\colon X\to X$ be a nilpotent linear map. How can I show that $X$ must have infinitely many $T$-invariant subspaces if and only if $T\circ T=0$.

-

If $X$ is nilpotent, i.e. $X^n = 0$ for some $n$, then $0$ is the only possible eigenvalue of $X$. IF $X \neq 0$, this leaves you with only two possible jordan canonical forms of $X$, namely $$\begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix} \quad\text{and}\quad \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix} \text{.}$$ (Note that you can't have a pair of complex conjugate eigenvalues, since that'd mean that $T$ acts as a rotation on some 2-dimensional subspace and hence isn't nilpotent)
In the first case, you have $T^2 \neq 0$, so what remains to show is that exactly the second case has infinitly many $T$-invariant subspaces. That the second case has infinitely many $T$-invariant subspaces is quite obvious - every linear combination of $(1,0,0)$ and $(0,1,0)$ spans such a subspace. This leaves you with arguing why the first case can only have finitely many $T$-invariant subspaces (4, if I'm not mistaken), which I'll leave to you.