Let $f:\mathbb{R}\to \mathbb{R}$ be a continuous and midpoint convex function, which means that
$$\forall x,y\in \mathbb{R}\;,\;\;\displaystyle{ f\left(\frac{x+y}{2}\right)\leq \frac{f(x)+f(y)}{2} .}$$
Assume there exists $a,b\in \mathbb{R}$ such that $f(a)=f(b)=0$.
Show that $f\leq 0$ on $[a,b]$. And in a second time, deduce that $f$ is convex.
Any hint would appreciated.
Hint: To make it simple, look at the case $a = 0, b = 1$; any other case reduces to this via $$ g(x) = f(\frac{x-a}{b-a}). $$ Can you show that if $f(x), f(y) \le 0$, then $f(p) \le 0$ where $p$ is the average of $x$ and $y$?
If so, then you know that $f$ is negative at every point of the form $$ \frac{n}{2^k} $$ where $n$ is an integer and $0 \le \frac{n}{2^k} \le 1$.
Now: in what way have we used the continuity of $f$ so far?