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.