This question already has an answer here:
Let $f$ be a real-valued function for which, for every real $x,y$:
$$f(x+y) = f(x)+f(y)$$
Does this imply that $f$ is a linear function ($f(x)=a\cdot x$)?
If $f$ is differentiable, I think the answer is yes. Take the derivative of $f(x+y)$ by $x$: $f'(x+y)=f'(x)$. This is true for all $y$, hence $f'$ is a constant function. Additionally, $f(0)=f(x+0)-f(x)=0$. Hence $f(x)=ax$. (is this correct?)
If $f$ is continuous, I think the answer is also yes. First, note that $f(0)=0$. Let $a=f(1)$. By addition, for every integer $x$, $f(x)=a\cdot x$. This also must be true for every rational $x$. Hence, by continuity, it must be true for all $x$. (is this correct?)
What is the answer for general $f$?