Attempt : Suppose $A$ has a non-zero eigenvalue $\lambda$. Then corresponding to it's non-zero eigen vector $X$, we have $AX=\lambda X \Rightarrow A^2X=\lambda^2 X\Rightarrow 0=\lambda^2 X$. Which is a contradiction. Hence $\lambda=0$ with algebraic multiplicity $5$.
Looking at all the Jordan normal forms $J$ of $A$, I found one $J$ which gives $J^2=0$ whose $\text {Rank} J=2$. (There is other Jordan normal form with rank$=1$)
Here is that J := $$J = \begin{pmatrix} 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ \end{pmatrix} $$
I found that Jordan normal forms with ranks $3,4$ don't satisfy $J^2=0$. So the least upper bound for the rank is $2$. Is my attempt correct? Thanks.
Here is a proof not relying on Jordan normal form.
You have exhibited a $5 \times 5$ matrix that has rank $2$.
Let us work by contradiction for the cases $n \geq 3$.
Let us assume that there exists an $A$ with
(1) rank$(A)\geq 3$ and
(2) $ \ A^2=0.$
By definition of rank function: (1) means that dim$(Im(A)) \geq 3$;
thus, by rank-nullity theorem : dim$(Ker(A)) \leq 5-3=2.$
Let us take any $X \in Im(A)$, it is thus of the form $X=AY$ for a certain $Y$.
Using (2) : $AX=A^2Y=0$ ; thus $X \in Ker(A)$.
As a conclusion: $Im(A) \subset Ker(A)$, which is impossible considering the dimensionalities $ \geq 3$ and $ \leq 2$ obtained above.