The set of all nilpotent matrices is closed. Is it connected? Prove that the set of all $n\times n$ nilpotent matrices is a closed set when considered as a subset of $\mathbb{R}^{n^2}$ and the metric is the usual euclidean metric. Also if it is connected as a subset of $\mathbb{R}^{n^2}$
 A: Let $\phi(A) = A^n$. $\phi$ is continuous, and the set of nilpotent matrices is $\phi^{-1} \{0 \}$, hence closed.
If $A$ is nilpotent, then so is $\lambda A$ for any $\lambda$. It follows that $A$ is path connected by a straight line to $0$. Hence any two nilpotent matrices are connected by a path through $0$. Hence the set of nilpotent matrices is (path) connected.
A: In comments, Alex Ravsky asks if the set of non-zero nilpotent matrices is connected.
The answer is no if $n=2$. Indeed, in that case, that set is the conjugacy class of $$N=\begin{pmatrix}0&1\\0&0\end{pmatrix}.$$
So we have to show that this conjugacy class is not connected. The real conjugacy class of a matrix $M$ is path-connected if and only if the intersection of the commutator of $M$ with $\operatorname{GL}_n(\mathbb R)$ contains an element of negative determinant (if that is not the case, the map from the conjugacy class to $\operatorname{GL}_{n}(\mathbb R)/\operatorname{GL}_{n}^+(\mathbb R)\simeq\{±1\}$ is a continuous map which is not constant). The matrix $N$ is cyclic, so its commutant is $\mathbb R[N]$. The determinant of $a_0 Id+a_1 N$ is $a^2_0\geq 0$. So the conjugacy class of $N$ is not connected.
Over $\mathbb C$ or over $\mathbb R$ if $n$ is odd, the set of non-zero nilpotent matrices is path-connected. In that two cases, the conjugacy class of a nilpotent matrix $M$ is path-connected (in the real case, because $-Id$ commutes with $M$), so it is enough to show that there is a path in the set of non-zero nilpotent matrices from the companion matrix of $X^n$ (the matrix with zero coefficients everywhere except on the small diagonal, and with ones there) to any nilpotent matrices in Jordan normal form. This is easily achieved by letting the desired number of coefficients go to zero on the small diagonal.
