$|f(x)-f(y)|\le(x-y)^2$ without gaplessness

You only need the set where $f$ is defined to be dense. The theorem is true in metric spaces, and in that generality, density is more than enough, all you really need is the ability to move from point to point in arbitrarily short steps.

Hopping from $x$ to $y$ in $n$ short steps of size $O(1/n)$ bounds $|f(x)-f(y)|$ as $n O(1/n^2)$, which goes to zero for large $n$.

For the general case in a metric space, define the connected components for "hopping" by $x \sim y$ if for every $e > 0$ there is a finite chain of points starting at $x$ and ending at $y$, with consecutive points all at distance $ < e$ (and a bound, independent of $e$, on the total length of the consecutive jumps). Then

  • a function satisying the inequality is constant on hopping components

  • any two hopping components are at positive finite distance from each other (a "gap"), if the metric space is compact

  • the function can have different values for different components.

The exact amount of freedom to define $f$ differently on the components is an interesting and potentially more difficult question when there are infinitely many components or, in the noncompact case, pairs of components that come arbitrarily close to each other.

The only property of the upper bound $(x-y)^2$ that is used here is that it vanishes to order higher than $1$ for small $|x-y|$.


Let $x = x_0 < x_1 < \dots < x_n = y$ be a family of sequences such that $|x_i - x_{i+1}| \rightarrow 0$ Then use triangle inequality and you can make $|f(x) - f(y)|$ arbitrarily small.