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. 
\[ x f(2 f(0) - x) = \frac{f(x)^2}{x} + f(0). \]
The nicest part of the problem is the following step:
\[ \text{Claim - We have } f(0) = 0. \]
\[ f(0) = 0. \]
Claim - We have \( f(x) \in \{0, x^2\} \) for each individual \( x \).
\[ 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 \{0, x^2\} \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(2x) = 0 \]
for any integer \( x \neq 0 \), and hence conclude that \( f(2\mathbb{Z}) \equiv 0 \). Then selecting \( x = 2k \neq 0 \) in the given implies that
\[ y^2 f(4k - 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(4k - m^2) = f(m^3). \]
If \( f(m^3) \neq 0 \) this forces \( f(4k - m^2) \neq 0 \), and hence \( m^2 (4k - m^2)^2 = m^6 \) for arbitrary \( k \neq 0 \), which is clearly absurd. That means
\[ f(4k - m^2) = f(m^2 - 4k) = f(m^3) = 0 \]
for each \( k \neq 0 \). Since \( m \) is odd, \( m^2 \equiv 1 \pmod{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) = \begin{cases} 
1 & x = \pm 1 \\ 
0 & \text{otherwise} 
\end{cases} \]
To show that the latter fails, we simply take \( x = 5 \) and \( y = 1 \) in the given.