# Prove that function is constant

Prove that a function $f:\mathbb{R}\to\mathbb{R}$ which satisfies $$f\left({\frac{x+y}3}\right)=\frac{f(x)+f(y)}2$$ is a constant function.

This is my solution: constant function have derivative $0$ for any number, so I need to prove that $f'$ is always $0$. I first calculated $\frac{d}{dx}$ and then $\frac{d}{dy}$: $$f'\left({\frac{x+y}3}\right)\frac13=\frac{f'(x)}2$$ $$f'\left({\frac{x+y}3}\right)\frac13=\frac{f'(y)}2$$ From this I can see that $\frac{f'(x)}2=\frac{f'(y)}2$. Multiplying by $2$ and integrating I got: $$f(x)=f(y)+C$$ for some constant $C\in\mathbb{R}$. By definition of $f$ it is true for any $x,y\in\mathbb{R}$, so I can write $$f(y)=f(x)+C$$ Adding this two equation and simplifying I got $$C=0$$ so $f(x)=f(y)$ for all $x,y\in\mathbb{R}$. Is my solution mathematically correct. Is this complete proof, or I missed something?

• Why do we assume that $f$ is differentiable? I wonder if the statement is necessarily true if $f$ is allowed to be discontinuous. – Ben Grossmann Jan 6 '15 at 17:10

It is not even necessary to assume that $f$ is continuous.

1. By letting $y = 2x$, we see that $f(x) = f(2x)$
2. 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)$
3. 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.
• Very nicely done :) – Eric Stucky Jan 7 '15 at 5:03
• This also shows that short + simple = elegant. – TobiMcNamobi Jan 7 '15 at 14:16

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$.

• $\left({\frac23}\right)^nx_0$ is equal to $0$ only at $n\to\infty$. Why it means that $f(x_0)=0$? – user164524 Jan 6 '15 at 17:36
• Because $f(x_0) = f((\frac23)^n x_0)$ for every $n$, and by the continuity of $f$, we must have $f(x_0) = f(0)$. – Ben Grossmann Jan 6 '15 at 18:13
• Isn't it wrong to assume $f$ is continuous in the proof that a function is constant (and thus continuous)? – orion Jan 7 '15 at 10:27
• @orion I don't think so, not all continuous functions are constant, so here it's shown that any continuous function that satisfies the condition must be constant. It could be that there exist discontinuous functions that also satisfy the condition (actually, there aren't) so it doesn't fully answer the problem, but it's not a vacuous proof. – Thomas Jan 7 '15 at 12:02

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)$.

Unfortunately your solution is incorrect in several ways.

First of all, the formulation of the problem is not accurate because your equation does not define a function $f$. What you probably mean is: Prove that every function $f:\mathbb{R}\to \mathbb{R}$ satisfying (equation) is constant. Also you need at least the assumption that $f$ is continuous. Otherwise the statement is not true.

Your method requires the assumption that $f$ is differentiable. But even then, you only show that $f'$ is constant, $f'(x)=f'(y)$ for all $x,y\in \mathbb{R}$. But you cannot integrate this to $f(x)=f(y)+C$. Rather, a linear function $f(x)=\alpha x+\beta$ has a constant derivative as well.

• Can you find a counterexample in the case that $f$ is not continuous? I suspect that it isn't so easy to find one. – Ben Grossmann Jan 6 '15 at 17:27
• You're right, it's not so easy, my first attempts to find a counterexample were not successful. My statement that there is one was based on intuition, but I still strongly believe in it. – Florian Jan 6 '15 at 17:42
• @Florian: See anonymath's answer below. – ruakh Jan 7 '15 at 3:16

for all $x$ real \begin{array}{l} f\left( { - x} \right) = f\left( {\frac{{ - 2x - x}}{3}} \right) = \frac{{f\left( { - 2x} \right) + f\left( { - x} \right)}}{2} \\ \Leftrightarrow f\left( { - x} \right) = f\left( { - 2x} \right) \cdots \cdots \left( 1 \right) \\ f\left( 0 \right) = \frac{{f\left( x \right) + f\left( { - x} \right)}}{2} \cdots \cdots \left( 2 \right) \\ f\space \text{is continuous at 0} \\and\\ \left( 1 \right)and\left( 2 \right) \Leftrightarrow f\left( 0 \right) = \frac{{f\left( x \right) + f\left( { - 2x} \right)}}{2} = f\left( { - x} \right) \\ \mathop {\lim }\limits_{x \to 0} f\left( x \right) = f\left( 0 \right) = 0 = \mathop {\lim }\limits_{x \to 0} f\left( {\frac{2}{3}x} \right) = \mathop {\lim }\limits_{x \to 0} f\left( {\left( {\frac{2}{3}} \right)^n x} \right) \\ \Leftrightarrow f = \text{const} \\ \end{array}

• How $f(-x)=-f(-2x)$? – user164524 Jan 6 '15 at 18:10
• forgiveness I made a sign of lack – sabachir Jan 6 '15 at 19:03