Find all $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that
$$
x f(2 f(y)-x)+y^{2} f(2 x-f(y))=\frac{f(x)^{2}}{x}+f(y f(y))
$$
for all $x, y \in \mathbb{Z}$ such that $x \neq 0$.
The answer is $f(x) \equiv 0$ and $f(x) \equiv x^{2}$. Check that these work.
Now let's prove these are the only solutions. Put $y=0$ to obtain
$$
x f(2 f(0)-x)=\frac{f(x)^{2}}{x}+f(0) \text {. }
$$

The nicest part of the problem is the following step:
Claim - We have $f(0)=0$.

Proof. If not, select a prime $p \nmid f(0)$ and put $x=p \neq 0$. In the above, we find that $p \mid f(p)^{2}$, so $p \mid f(p)$ and hence $p \left\lvert\, \frac{f(p)^{2}}{p}\right.$. From here we derive $p \mid f(0)$, contradiction. Hence
$$
f(0)=0 \text {. }
$$

Claim - We have $f(x) \in\left\{0, x^{2}\right\}$ for each individual $x$.

Proof. The above then implies that
$$
x^{2} f(-x)=f(x)^{2}
$$
holds for all nonzero $x$, but also for $x=0$. Let us now check that $f$ is an even function. In the above, we may also derive $f(-x)^{2}=x^{2} f(x)$. If $f(x) \neq f(-x)$ (and hence $x \neq 0$ ), then subtracting the above and factoring implies that $f(x)+f(-x)=-x^{2}$; we can then obtain by substituting the relation
$$
\left[f(x)+\frac{1}{2} x^{2}\right]^{2}=-\frac{3}{4} x^{4}<0
$$
which is impossible. This means $f(x)^{2}=x^{2} f(x)$, thus
$$
f(x) \in\left\{0, x^{2}\right\} \quad \forall x .
$$

Now suppose there exists a nonzero integer $t$ with $f(t)=0$. We will prove that $f(x) \equiv 0$. Put $y=t$ in the given to obtain that
$$
t^{2} f(2 x)=0
$$
for any integer $x \neq 0$, and hence conclude that $f(2 \mathbb{Z}) \equiv 0$. Then selecting $x=2 k \neq 0$ in the given implies that
$$
y^{2} f(4 k-f(y))=f(y f(y)) .
$$

Assume for contradiction that $f(m)=m^{2}$ now for some odd $m \neq 0$. Evidently
$$
m^{2} f\left(4 k-m^{2}\right)=f\left(m^{3}\right) \text {. }
$$

If $f\left(m^{3}\right) \neq 0$ this forces $f\left(4 k-m^{2}\right) \neq 0$, and hence $m^{2}\left(4 k-m^{2}\right)^{2}=m^{6}$ for arbitrary $k \neq 0$, which is clearly absurd. That means
$$
f\left(4 k-m^{2}\right)=f\left(m^{2}-4 k\right)=f\left(m^{3}\right)=0
$$
for each $k \neq 0$. Since $m$ is odd, $m^{2} \equiv 1(\bmod 4)$, and so $f(n)=0$ for all $n$ other than $\pm m^{2}$ (since we cannot select $k=0$ ).
Now $f(m)=m^{2}$ means that $m= \pm 1$. Hence either $f(x) \equiv 0$ or
$$
f(x)=\left\{\begin{array}{ll}
1 & x= \pm 1 \\
0 & \text { otherwise }
\end{array}\right.
$$

To show that the latter fails, we simply take $x=5$ and $y=1$ in the given.
Hence, the only solutions are $f(x) \equiv 0$ and $f(x) \equiv x^{2}$.