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