TITLE: Given $|f(x) - f(y)| \leq 7(x-y)^2$ show $f$ is a constant function
QUESTION [6 upvotes]: I think that I've managed to figure this one out, I was just wondering if someone could look it over because there are a few areas that I'm not sure about my steps. Here is the full question: 

Suppose $f$ is a real valued function defined on all $x$ and $|f(x) - f(y)| \leq 7(x-y)^2$ for all $x$ and $y$. Prove $f$ is a constant function. 

First, define $y = x+h$ and take $h \neq 0$, then $|f(y) - f(x)| \leq 7(x-y)^2$ becomes $|f(x+h) - f(x)| \leq 7h^2$. Dividing by $|h|$ we get:
$\left|\frac{f(x+h) - f(x)}{h}\right| \leq 7|h|$. 
Clearly, $\lim_{h\rightarrow 0} 7|h| = 0$. Then by the sandwich theorem (squeeze theorem):
$\lim_{h\rightarrow 0} \left|\frac{f(x+h) - f(x)}{h}\right| = 0.$ And thus $f'(x) = 0$ for arbitrary $x$. So $f(x)$ is a constant function. 
Added crucial condition on $h$ thanks to help from comments

REPLY [3 votes]: Let us take two arbitrary real numbers $x$ and $y$. Let $h=y-x.$
Let us subdivide $(x,y)$ into $n$ equal length intervals $(x_k,x_{k+1})$ with $x_0=x$ and $x_n=y$, (thus all with length $\tfrac{h}{n}$):
$$|f(x)-f(y)|=|\sum_{k=0}^{n-1}(f(x_{k+1})-f(x_k))|\leq \sum_{k=0}^{n-1}|(f(x_{k+1})-f(x_k)|\leq n 7 (\tfrac{h}{n})^2=7\tfrac{h^2}{n}$$
which can be given an arbitrary small value.
Thus $f(x)=f(y)$; as $x$ and $y$ are arbitrary, $f$ is thus a constant function.
Remark: of course, coefficient $7$ could be replaced by any positive constant. Moreover exponent $2$ could have been any (Hölder) exponent $\alpha>1$ (see remark by @Luca).