Continous and Midpoint convex implies convex (trying to understand a proof) .Hello, I would appreciate some help in trying to understand a proof.
I was reading these notes : https://assets.cambridge.org/97811070/07314/excerpt/9781107007314_excerpt.pdf , and I found a proposition (proposition 1.3 in page 3) with a proof:
If a function f defined in $(a,b)$ is midpoint convex and continous in (a,b) then f is convex.
Basically, the proof consists in showing by induction that $ f( \frac{j}{2^n}x + (1 - \frac{j}{2^n})y) \leq \frac{j}{2^n}f(x) + (1- \frac{j}{2^n})f(y) $ for all $ 0 \leq j \leq 2^n $, that is, to prove the inequality for $\theta $ a dyadic rational.( The case of $ f( \frac{1}{2}x + (1 - \frac{1}{2})y) \leq \frac{1}{2}f(x) + (1- \frac{1}{2})f(y) $ is a particular example of $\theta $ a dyadic rational and this hypothesis helps in the induction part $n=1$)
Then, since our function f is continous, the inequality holds for all $\theta \in (0,1) $. Then f is convex applying definition of convexity $ f( \theta x + (1 - \theta)y) \leq \theta f(x) + (1- \theta)f(y) $ with $\theta \in (0,1)$
I dont understand that last part : Why I can conclude that, since the function is continous, the inequality holds not only for $\theta$ a dyadic rational but for all $\theta \in (0,1 $)?
It is something trivial or there is something behind?
Thanks!
 A: For any fixed $x,y,$ the function $g_{x,y}(\theta)=\theta f(x) +(1-\theta)f(y)-f(\theta x+(1-\theta)y)$ is continuous from $[0,1]$ to $\Bbb R$ and is non-negative on a dense subset of $[0,1]$ (on the dyadic rationals) so it must be non-negative for all $\theta\in [0,1].$
FYI. Here is another proof, by contradiction. Suppose $a<c_0<b$ and $f(c_0)>rf(a)+(1-r)f(b)$ where $r=(b-c_0)/(b-a) .$ Let $g(x)$ be linear with $g(a)=-f(a)$ and $g(b)=-f(b).$ The function $h(x)=f(x)+g(x)$ is continuous and midpoint-convex with $h(a)=h(b)=0<h(c_0).$
We will show by induction that for all  $n\in \Bbb N_0$ there exists $c_n\in (a,b)$ with $h(c_n)\ge 2^nh(c_0).$ Since $h(c_0)>0$, this makes $h$ unbounded on $[a,b]$ contrary to the continuity of $h.$
Suppose $c_n\in (a,b)$ and $h(c_n)\ge 2^nh(c_0).$ We have $c_n\ne (a+b)/2$ because $h$ is midpoint-convex with $h(a)=h(b)=0$ so $h((a+b)/2)=0.$
If $c_n<(a+b)/2,$ let $c_{n+1}=2c_n-a\in (a,b).$ Then $c_n=(a+c_{n+1})/2,$ so $2^nh(c_0)\le h(c_n)\le  (h(a)+h(c_{n+1}))/2=h(c_{n+1})/2.$
If $c_n>(a+b)/2$ let $c_{n+1}= 2c_n-b\in (a,b)$  with same result. (Details are for the reader).
This can be done without the ancilary functions $g,h.$ It's  the same proof with a lot more typing.
