Find the functions Find all the functions $ f : \mathbb{Q} \rightarrow \mathbb{Q} $ with the following property:
$$ f(x + 3f(y)) = f(x) + f(y) + 2y, \: \forall x, y \in \mathbb{Q} $$
 A: I will show that the only solutions are $f(x)=x$ and $f(x)=-2/3x$.

Step 1. $f(x)=0$ if and only if $x=0$.

Proof. If $f(y)=0$, then $y=0$. Setting $y=0$ and $x=-3f(0)$ then gives $f(x)=0$, thus $-3f(0)=0$ and $f(0)=0$.

Step 2. If $A:=3f(\mathbb Q)=\{3f(x)\ |\ x\in\mathbb Q\}$, then
  \begin{align*}
f(x+y)&=f(x)+f(y), \\
f(-y)&=-f(y), \qquad x\in\mathbb Q,y\in A,\\
y,y'\in A\ &\Rightarrow\ y+y'\in A \\
y\in A\ &\Rightarrow\ -y\in A.
\end{align*}

Proof. From Step 1 it follows that $f(3f(y))=f(y)+2y$ for all $y\in\mathbb Q$. In particular, $f(x+3f(y))=f(x)+f(3f(y))$ for all $x,y\in\mathbb Q$, which shows the first equality. By using $x:=-y$ this implies by Step 1: $0=f(0)=f(-y+y)=f(-y)+f(y)$ and hence $f(-y)=-f(y)$ for $y\in A$, which shows the second equality. The last implications follow immediately from the first two equalities.

Step 3. We have
  \begin{align*}
 f(ny)&=nf(y),\qquad y\in A,n\in\mathbb Z, \\
 y\in A\ &\Rightarrow ny\in A,\qquad n\in\mathbb Z.
\end{align*}

Proof. If $n>0$, then $f(ny)=nf(y)$ from Step 2. If $n<0$ and $y\in A$, then $ny=(-n)(-y)$, and since $-y\in A$ it follows again from Step 2 that $f(ny)=f((-n)(-y))=-nf(-y)=(-n)(-f(y))=nf(y)$. Again, the implication follows easyly.

Step 4. We have
  \begin{align*}
 f(qy)&=qf(y),\qquad y\in A,q\in\mathbb Q, \\
 y\in A\ &\Rightarrow qy\in A,\qquad q\in\mathbb Q.
\end{align*}

Proof. Let $y\in A$, $q=\frac{m}{n}$, $m\in\mathbb Z,n\in\mathbb N$. Then by Step 3
\begin{align*}
\frac{m}{n}f(y)=\frac{1}{n}f(my)=\frac{1}{n}f\left(\frac{mny}{n}\right)=\frac{n}{n}f\left(\frac{m}{n}y\right)=f\left(\frac{m}{n}y\right)
\end{align*}
or in other words $f(qy)=qf(y)$.

Step 5. $A=\mathbb Q$.

Proof. Step 2 and Step 4 show that $A$ is a $\mathbb Q$-vector space, and since $A\subset\mathbb Q$ we have either $A=\{0\}$ or $A=\mathbb Q$. The former, however, would contradict Step 1.

Step 6. $f(x)=x$ or $f(x)=-2/3x$.

Proof. Steps 2, 4 and 5 show that $f$ is linear, i.e. $f(x)=ax$ for some $a\in\mathbb Q$ and all $x\in\mathbb Q$. Then for $x=0$ and $y=1$ the given equation gives $3a^2=a+2$, and this quadratic equation has only the two solutions $a=1$ and $a=-2/3$.
