# Why is this the set of constant functions?

Prove the set of functions $f: \mathbb R \rightarrow \mathbb R$ having the following property ($\epsilon, \delta,x_1,x_2 \in \mathbb R$)

$\forall \epsilon >0 \qquad, \exists \delta>0 \qquad, (x_1-x_2) < \delta \Rightarrow |f(x_1)-f(x_2)|<\epsilon$

is the set of constant functions.

I'm failing to understand why this is true.

If $f$ is constant I can see that:

There is always a positive $\delta$ such that $x_1-x_2<\delta$ and $|f(x_1)-f(x_2)|=0<\epsilon$, but I don't see the implication. Also I can't see why this is not valid for non-continuous functions.

Because you removed the absolute values around $x_1-x_2$ (from the usual definition of continuity), so that $x_1-x_2$ now can be negative. And that makes the implication problematic, as its condition can be trivially verified.
Assume $f$ is not constant but satisfies the property: this implies there exist $x_1<x_2$ such that $f(x_1)\neq f(x_2)$. Set $$\varepsilon \stackrel{\rm def}{=} \frac{\lvert f(x_1)-f(x_2)\rvert}{2}>0\,.$$ By the property, there exists some $\delta >0$ corresponding to this $\varepsilon$. But our particular $x_1,x_2$ satisfy the premise, since $$x_1-x_2 < 0 \leq \delta$$ and therefore must satisfy the conclusion: $$\lvert f(x_1)-f(x_2)\rvert < \varepsilon = \frac{\lvert f(x_1)-f(x_2)\rvert}{2}$$ which is a contradiction.
Let $x<y$. Note that for any $\delta>0$, $x-y<\delta$. It follows from the assumption that for any $\epsilon>0$, $|f(x)-f(y)|<\epsilon$. This means that $|f(x)-f(y)|=0$ or $f(x)=f(y)$. Since $x<y$ were arbitrary, $f$ is constant.
• I don't understand exactly what this mean "Since $x<y$ were arbitrary". When $x>y$ I can't use $x-y<\delta$, right?
• If the numbers are $a>b$ then you set $x=b$ and $y=a$ and $x-y <\delta$. What the sentence means is that, subject to satisfying the restriction $x <y$, the variables $x,y$ can take any values whatsoever. Jan 15, 2018 at 23:47