Given a function $f(x)$ defined for all real $x$,and is such that $f(x+h)-f(x)<6h^2$ for all real $h$ and $x.$Show that $f(x)$ is constant Given a function $f(x)$ defined for all real $x$,and is such that 
$$f(x+h)-f(x)<6h^2$$
for all real $h$ and $x.$Show that $f(x)$ is constant.

To prove $f(x)$ as constant i need to prove that $f'(x)=0.$
$f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}<\lim_{h\to 0} 6h$
$f'(x)<0$
I am not able to prove $f'(x)$ equal to zero.Please help me.Thanks.
 A: You first need to show $f$ is differentiable -- this is not obvious that the limit you are taking on the LHS actually exists, you have to prove it first.
To do so, killing two birds with one stone, fix any $x_0\in\mathbb{R}$, and consider, for any $h >0$
$$f(x_0+h) - f(x_0) < 6h^2$$
and
$$f(x_0) - f(x_0+h) = f(\underbrace{x_0+h}_{x}+\underbrace{(-h)}_{h^\prime}) - f(\underbrace{x_0+h}_{x}) < 6{\underbrace{(-h)}_{h^\prime}}^2 = 6h^2$$
the second applying the assumption to $x = x_0+h$ and $h^\prime=-h$. Combining the two shows that
$$
-6h^2 < f(x_0+h) - f(x_0) < 6h^2
$$
for any $h$. Now, taking an arbitrary $h \neq 0$, you get
$$
-6h < \frac{f(x_0+h) - f(x_0)}{h} < 6h
$$
and taking the limit should now do the trick (it implies both that the limit exists — $f$ is differentiable at $x_0$ — and that it is $0$, by the squeeze theorem).
A: Here is a solution for the original problem which does not involve the use of derivatives:
Rewrite the condition of the problem as $f(x)-f(y)\le 6(x-y)^2,\forall x,y\in\mathbb{R}$.We have:
$$f(a)-f(b)=[f(a)-f\left(a-\frac{a-b}{n}\right)]+[f\left(a-\frac{a-b}{n}\right)-f\left(a-2\cdot\frac{a-b}{n}\right)]+...+[f\left(a-(n-1)\cdot\frac{a-b}{n}\right)-f(b)]\le \underbrace{6\cdot\left(\frac{a-b}{n}\right)^2+6\cdot\left(\frac{a-b}{n}\right)^2+...+6\cdot\left(\frac{a-b}{n}\right)^2}_{n \text{times}}=6\cdot\frac{(a-b)^2}{n},\forall n\in\mathbb{N}^*.$$
Hence $f(b)-f(a)\le 6\cdot\frac{(b-a)^2}{n}=6\cdot\frac{(a-b)^2}{n},\forall n\in\mathbb{N}^*$.Therefore $$-6\cdot\frac{(a-b)^2}{n}\le f(a)-f(b)\le 6\cdot\frac{(a-b)^2}{n},\forall n\in\mathbb{N}^*.$$
Now,the key observation is that $\lim_{n\to\infty}\frac{(a-b)^2}{n}=0$.From here(after using the above inequality) is pretty clear that $f(a)=f(b)$.
Note: From this solution it follows that $6$ is irrelevant.We can easily put any $k\in\mathbb{R}$ instead of $6$
