I found this problem in an old book of mine. The question asks to find all the functions $f: \mathbb Q \to \mathbb R$ which satisfy $f(x+f(y)) = f(x) + y$ for all rational numbers $x,y$. Also I am unsure what $f: \mathbb Q \to \mathbb R$ means exactly when compared to $f: \mathbb R \to \mathbb R$
I have been experimenting with this problem and the only two functions I could find were $f(x) = x$ or $f(x) = -x$. Although these functions seem to be the only working ones (purely based on guess and check), I cannot seem to find a proof.
As Servaes pointed out in a comment, we see that $f(x)\in \mathbb{Q}$ for all $x$.
To solve $f: \mathbb R \to \mathbb R$ you need some aditional asumption for $f$. You can not say $f(x)=ax$ immediately.