Official solution
Given z = x + iy
and \[{z^2} = i{\left| z \right|^2}\]
\[ \Rightarrow \] (x + iy)2
= i(x2 + y2)
\[ \Rightarrow \] x2 - y2 + 2ixy = i(x2 + y2) + 0
Comparing both side we get,
x2 - y2 = 0
\[ \Rightarrow \] x2 = y2
and 2xy = (x2 + y2)
\[ \Rightarrow \] (x - y)2 = 0
\[ \Rightarrow \] x = y
\[ \therefore \] z lies on line x = y