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?

Note that $A^4=0$. Thus all eigenvalues of $A$ must be $0$ thus its Jordan normal form has one of the following forms
$$
A_1=\left( \begin {array}{ccc} 0&0&0\\ 0&0&0 \\ 0&0&0\end {array} \right) \text{ or }  
A_2=\left( \begin {array}{ccc} 0&1&0\\ 0&0&0 \\ 0&0&0\end {array} \right)
\text{ or }
A_3=\left( \begin {array}{ccc} 0&1&0\\ 0&0&1 \\ 0&0&0\end {array} \right)
$$
The first two options are immediately disqualified because their square is $0$. Thus $A$ must be similar $A_3$, i.e. $A= CA_3C^{-1}$ for an invertible C. Now $B = A^2 = C A_3^2 C^{-1} = C B C^{-1}$, thus $B$ and $C$ have to commute. Thus your space of solutions to $A^2 = B$ is given by
$$\{CA_3C^{-1}\vert C \in Gl(\mathbb{R},3), [B,C] = 0\}$$
By solving the linear equation $[B,C] = 0$ you see $C$ satisfies $C \in Gl(\mathbb{R},3), [B,C] = 0$ if and only if it is of the form
$$C=\left( \begin {array}{ccc} \lambda&*&*\\ 0&\mu&* \\ 0&0&\lambda\end {array} \right) $$
for $\lambda,\mu \neq 0$.
