I solved it and got three solutions
$(1,1,1)$ is obvious, no need to calculate it.
other two solutions are $(4,2\sqrt{2}),(4,2,-\sqrt{2})$
But actual answer is only $(1,1,1),(4,2,\sqrt{2})$.
One can see that all these three triplets are satisfying the equation.
What am I missing here.
My attempt is as follows:
$$z^x=x$$ $$x\log (z)=\log (x)$$ $$\log (z)=\frac {\log (x)}{x}$$ $$z^y=y$$ $$\log (z)=\frac {\log (y)}{y}$$
$$\frac {x}{y}=\frac {\log (x)}{\log (y)}$$ $$y^y=x$$ $$y\log (y)=\log (x)$$ $$y=\frac {\log (x)}{\log (y)}$$ $$x=y^2$$
$$y^y=x$$ $$y^y=y^2$$ $$y=2$$ $$x=2^2$$ $$x=4$$ $$z=\sqrt{2},-\sqrt{2}$$
$z=-\sqrt{2}$ is not permissible.
This is because $\log(-\sqrt2)$, which is used in your derivation, is undefined. This spurious solution comes about because $y$ happens to be 2.
Edit:
As pointed out below in the comments, the function $z^y$ is defined for the domain $z>0$, which is implicit. To see why, for example, $(-1)^{1/2} \ne (-1)^{2/4}$, indicating that $z^y$ could have different values for $z=-1$ and can not be viewed as a function for negative value $z$. If any negative value is allowed for the solution, it needs to be explicitly stated in the question.