# A condition for mid-convex implies convex

Let I an open interval, and $f: I \rightarrow \mathbb{R}$ such that:

$\forall (x,y) \in I^2 ; f(\frac{x+y}{2}) \le \frac{f(x)+f(y)}{2}$

There exists an interval $[a,b]$ such that $a<b$ and $[a,b] \subset I$ and f is bounded on $[a,b]$

Prove that f is convex

I have an idea to prove that f is bounded on I, then to prove that f is continous so we can apply the lemma here Midpoint-Convex and Continuous Implies Convex, but I didn't succeed to prove the continuity.

Let $D$ be the set of dyadic rationals in $[0,1]$, i.e. numbers of the form $\frac{a}{2^k}$ with $a,k\in\mathbb{N}$ and $a\leq 2^k$. Midpoint convexity gives that the Jensen's inequality: $$f(\lambda a +(1-\lambda) b)\leq \lambda f(a) + (1-\lambda) f(b)\tag{1}$$ holds for every $a,b\in I$ and $\lambda\in D$. Assuming that $|f|$ is bounded by $M$ on $I$, from:
$$f\left(x_0+\frac{1}{2^n}\right)=f\left(\frac{(2^n-1)x_0+(1+x_0)}{2^n}\right)\leq \left(1-\frac{1}{2^n}\right)f(x_0)+\frac{1}{2^n}f(x_0+1)$$ and: $$f\left(x_0+\frac{1}{2^{n+m}}\right)=f\left(\frac{(2^n-1)x_0+(2^{-m}+x_0)}{2^{n}}\right)\leq \left(1-\frac{1}{2^n}\right)f(x_0)+\frac{1}{2^n}f\left(x_0+\frac{1}{2^m}\right)$$ it follows that, for any $m$ big enough (in order to grant $x_0+\frac{1}{2^m}\in I$), we have: $$\left|f(x_0)-f\left(x_0+\frac{1}{2^{n+m}}\right)\right|\leq\frac{2M}{2^n}\tag{2}$$ implying the continuity of $f$ over the set $R=a+(b-a)D$. However, the set $R$ is dense in $[a,b]$, hence $f$ is continuous over $[a,b]$ and $(1)$ holds without further restrictions on $\lambda$.