I have found this problem:
Let $f : \mathbb{Q} → \mathbb{R}$ with property: $$|f(x) − f(y)| \le (x − y)^2 \tag1$$ for all $x, y \in \mathbb{Q}$. Prove $f$ is constant.
My idea is to consider the formal derivative of $f$ like this:
$$f'(x) = \lim_{h \rightarrow 0} \frac {f(x + h) - f(x)}{h}, h \in \mathbb{Q} $$
Using (1) it's easy to prove the limit exists and is equals $0$ for all $x \in \mathbb{Q}$. So $f$ has derivative and $f'(x)=0$ for all $x \in \mathbb{Q}$. It follows that $f$ is constant.
Unfortunately, it's not that simple because: $$f'\equiv 0 \implies \ f \ constant \tag 2$$ is a consequence of Mean Value Theorem which is valid only on real intervals.
My question: is (2) valid for $f: \mathbb{Q} \rightarrow \mathbb{R}$?
Obs. I don't need a proof for the problem.
The desired version of the Mean Value Theorem is not generally true for functions $g:\mathbb Q\to \mathbb R$. To see that consider the function: $$g(x) = \begin{cases} 0, & \text{if $x<\pi$} \\ 1, & \text{if $x>\pi$} \end{cases}$$
That function has derivative $0$ everywhere (as it is locally constant) but it is not a constant.
To your problem:
We have $$|f(x)-f(y)|=|f(x)-f\left(\frac {x+y}2\right)+f\left(\frac {x+y}2\right)-f(y)|≤|f(x)-f\left(\frac {x+y}2\right)|+|f\left(\frac {x+y}2\right)-f(y)|$$ $$≤\frac {(x-y)^2}2$$
Repeat this using the stronger estimate to see that $$|f(x)-f(y)|≤\frac {(x-y)^2}4$$ and iterate to see that ($\forall n\in \mathbb N$) $$|f(x)-f(y)|≤\frac {(x-y)^2}{2^n}$$
And as $n\to \infty$ we see that $f(x)=f(y)$.