I have the endomorphism $$ M = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix} $$ of a real vector space $V$. Note that this matrix is nilpotent (with $M^3 = 0$), not diagonalizable, and not invertible.
Basically, I need to show that this matrix does not have an infinite amount of invariant subspaces $U$. If $\dim U = 0$ or $\dim U = 3$, then we have the trivial invariant subspaces, but that's just 2 subspaces.
If $\dim U = 1$, then we have the following. If the basis of $U$ is the vector $(r, s, t) \neq \textbf{0}$, then we have $M \cdot (r, s, t) = (s, t, 0) \in U$, so $(s, t, 0) = \lambda (r, s, t) = (\lambda r, \lambda s, \lambda t) $ for some $\lambda \in R$. But then either $\lambda = 0$ or $t = 0$. The former (or both at the same time) would give us $s = t = 0$, so then $U$ would be the $x$-axis (so now we have 3 subspaces), and the latter would give a contradiction, since we now have $\lambda \neq 0$ and then we would have $r = s = t = 0$, contradicting the fact that $(r, s, t) \neq \textbf{0}$. [The reason we could say that $\lambda \neq 0$ is because we already handled the case of both $\lambda = 0$ and $t = 0$.]
But what about $\dim U = 2$? Does $M$ even have invariant subspaces of dimension 2? If so, how can we show that there is only a finite amount of them?
Let $P$ be an $M$-invariant plane. Note that $x\in P$ iff $x^Tu=u^Tx=0$. Here $x\in P$ implies $Mx\in P$, that is $x^Tu=0$ implies $u^TMx=x^T(M^Tu)=0$. Thus $u$ is an eigenvector of $M^T$; up to a factor, $u=[0,0,1]^T$ and the sole solution is the plane $x_3=0$.
A matrix $M\in M_n(K)$ admits a finite number of invariant subspaces iff $M$ is cyclic, that is, iff its minimal polynomial has degree $n$. Here the minimal polynomial of $M$ is $x^3$.