Determine all functions $f$ defined on the set of rationals that take rational values for which

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

for each $x$ and $y$.
The only solutions are $f(x)=x$ for all rational $x$ and $f(x)=-x$ for all rational $x$. Both of these readily check out.

Setting $y=x$ yields $f(3 f(x))=3 x$ for all rational $x$. Now replacing $x$ by $3 f(x)$, we find that

$$
f(9 x)=f(3 f(3 f(x))=3[3 f(x)]=9 f(x),
$$

for all rational $x$. Setting $x=0$ yields $f(0)=9 f(0)$, whence $f(0)=0$.

Setting $x=0$ in the given functional equation yields $f(f(y))=y$ for all rational $y$. Thus $f$ is one-one onto. Applying $f$ to the functional equation yields that

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

for every rational pair $(x, y)$.

Setting $y=0$ in the functional equation yields $f(2 f(x))=2 x$, whence $2 f(x)=f(2 x)$. Therefore $f(2 x)+f(y)=f(2 x+y)$ for each rational pair $(x, y)$, so that

$$
f(u+v)=f(u)+f(v)
$$

for each rational pair $(u, v)$.

Since $0=f(0)=f(-1)+f(1), f(-1)=-f(1)$. By induction, it can be established that for each integer $n$ and rational $x, f(n x)=n f(x)$. If $k=f(1)$, we can establish from this that $f(n)=n k, f(1 / n)=k / n$ and $f(m / n)=m k / n$ for each integer pair $(m, n)$. Thus $f(x)=k x$ for all rational $x$. Since $f(f(x))=x$, we must have $k^2=1$. Hence $f(x)=x$ or $f(x)=-x$. These check out.