Prove that function is constant
It is not even necessary to assume that $f$ is continuous.
- By letting $y = 2x$, we see that $f(x) = f(2x)$
- Letting $y = -4x$, we get $f(-x) = \frac{f(x) + f(-4x)}{2}$. However, from (1), $f(-4x) = f(-2x) = f(-x)$, so this simplifies to $f(-x) = f(x)$
- Finally, let $y = -x$ and simplifying gives $2f(0) = f(x) + f(-x)$. Substituting in from (2), this becomes $f(0) = f(x)$. Since this holds for all $x \in \mathbb{R}$, we conclude that $f$ must be constant.
The statement also holds if we only suppose that $f$ is continuous (and not necessarily differentiable).
Suppose that $f(x_0) \neq f(0)$ for some $x_0 \in \Bbb R$. We note that $$ f \left( \frac{x_0 + x_0}{3} \right) = \frac{f(x_0) + f(x_0)}{2} \implies\\ f\left( \frac 23 x_0\right) = f(x_0) $$ Then, consider the sequence $\left( \frac 23\right)^n x_0 \to 0$.
With $y=x$ we have by induction
$$f(x)=f\left(\frac23x\right)=f\left(\left(\frac23\right)^nx\right)$$ so we need just the hypothesis that $f$ is continuous at $0$ to get that $f(x)=f(0)$.