There are two problems given here. What are you asking about? For the first, "show that every diagonal matrix has a square root", that's not true unless the underlying field is the field of complex numbers. If the field is the complex numbers, then it is easy to see that the square root of $\begin{pmatrix}a & 0 \\ 0 & b \end{pmatrix}$ is $\begin{pmatrix}\sqrt{a} & 0 \\ 0 & \sqrt{b}\end{pmatrix}$.
To show that $\begin{pmatrix}0 & 1 \\ 0 & 0 \end{pmatrix}$ does not have a square root, look at the generic $\begin{pmatrix}a & b \\ c & d \end{pmatrix}$.
$\begin{pmatrix}a & b \\ c & d \end{pmatrix}^2a= \begin{pmatrix}a^2+ bc & ab+ bd \\ ac+ cd & bc+ d^2\end{pmatrix}$. In order that this be equal to $\begin{pmatrix}0 & 1 \\ 0 & 0 \end{pmatrix}$, we must have $a^2+ bc= 0$, $ab+ bd= 1$, $ac+ cd= 0$, and $bc+ d^2= 0$. The first and fourth equations give $a^2- d^2= (a- d)(a+ d)= 0$ so that either a- d= 0 or a+ d= 0.
If a= d then $ac+ cd= 2ac= 0$ so either a= 0 or c= 0. With a= 0, the equations become bc= 0, bd= 1, cd= 0 an $bc+ d^2= 0$. If b= 0, bd= 0 not 1 so we must have c= 0. But then d= 0 so that it cannot satisfy bd= 1 again.
If a= -d then $ab+ bd= ab- ab= 0$, not 1 so that is not possible.