Find all functions $f: \mathbb{Q} \rightarrow \mathbb{Q}$ such that

$$
f(f(x)+x f(y))=x+f(x) y
$$

where $\mathbb{Q}$ is the set of rational numbers.
Setting $x=0$ gives

$$
f(f(0))=f(0) y
$$

Since this must be true for all $y$, the only way this can happen is if $f(0)=0$. Now, setting $y=0$ gives

$$
f(f(x))=x
$$

for all $x$. Setting $x=y=-1$ gives

$$
f(f(-1)-f(-1))=f(0)=0=-1-f(-1) \Longrightarrow f(-1)=-1
$$

Setting $x=-1$ gives

$$
f(f(-1)-f(y))=f(-1-f(y))=-1-y .
$$

Applying $f$ to both sides and using $f(f(x))=x$ gives

$$
f(f(-1-f(-y)))=-1-f(-y)=-1-y .
$$

From here, we can use $f(-1)=-1$ and induction to show that $f(n)=n$ for all integers $n$. Now consider any rational number $y=\frac{m}{n}$. Setting $x=n$ gives

$$
\begin{gathered}
f\left(f(n)+n f\left(\frac{m}{n}\right)\right)=n+f(n) \cdot \frac{m}{n} \\
\Longrightarrow n+n f\left(\frac{m}{n}\right)=f\left(n+n \cdot \frac{m}{n}\right)=n+m \Longrightarrow f\left(\frac{m}{n}\right)=\frac{m}{n} .
\end{gathered}
$$

Thus, we must have $f(x)=x$ for all $x \in \mathbb{Q}$. Clearly, this function works, so it is the unique solution.