<s>[INST] Solve $A^2=B$ where $B$ is the $3\times3$ matrix whose only nonzero entry is the top right entry Find all the matrices $A$ such that  $$A^2= \left( \begin {array}{ccc} 0&0&1\\ 0&0&0 \\ 0&0&0\end {array} \right) $$  where $A$ is a $3\times 3$ matrix. 
$A= \left( \begin {array}{ccc} 0&1&1\\ 0&0&1 \\ 0&0&0\end {array} \right) $
 and 
$A= \left( \begin {array}{ccc} 0&1&0\\ 0&0&1 \\ 0&0&0\end {array} \right) $ work, 
but how can I find all the matrices?
 [/INST] You have $A^4=0$, and since it is a $3\times 3$ matrix it follows that $A^3=0$. This means that 
$$A\begin{pmatrix}
0&0&1\\
0&0&0\\
0&0&0\end{pmatrix}=0$$
and 
$$\begin{pmatrix}
0&0&1\\
0&0&0\\
0&0&0\end{pmatrix}A=0$$
Giving that
$$A=\begin{pmatrix}
0&a&b\\
0&c&d\\
0&0&0\end{pmatrix}$$ Now we have 
$$A^2=\begin{pmatrix}
0&ac&ad\\
0&c^2&dc\\
0&0&0\end{pmatrix}$$
 So $c=0$ and $ad=1$. Thus the general solution is 
$$A=\begin{pmatrix}
0&a&b\\
0&0&a^{-1}\\
0&0&0\end{pmatrix}.$$
</s>