Below is the proof of the fact that every midpoint-convex function is rationally convex, which I copied from my older post on a different forum.
If you add the condition that $f$ is continuous, then from rational convexity you will get convexity. (Note that if you are interested only in continuous functions, then it suffices to show the validity of $f(t x + (1-t)y)\le t f(x) + (1-t)f(y)$ for $t=\frac k{2^n}$ as suggested in Jonas' comment. The proof of this fact is a little easier. I've given a little more involved proof, since the relation between midpoint convexity and rational convexity seems to be interesting on its own.)
Maybe I should also mention that midpoint-convex functions are called Jensen convex by some authors.
Note that without some additional conditions on $f$, midpoint convexity does not imply convexity; see this question: Example of a function such that $\varphi\left(\frac{x+y}{2}\right)\leq \frac{\varphi(x)+\varphi(y)}{2}$ but $\varphi$ is not convex
Let $f: \mathbb R\to \mathbb R$ be a midpoint-convex function, i.e.
$$f\left(\frac{x+y}2\right) \le \frac{f(x)+f(y)}2$$
for any $x,y \in \mathbb R$.
We will show that then this function fulfills
$$f(t x + (1-t)y)\le t f(x) + (1-t)f(y)$$
for any $x,y\in \Bbb R$ and any rational number
$t\in\langle0,1\rangle$.
Hint: Cauchy induction: see Wikipedia (current revision) or
AoPS or answers to this post.
Proof. It is relatively easy to see that it suffices to show $f([x_1+\dots+x_k]/k)\le [f(x_1)+\dots+f(x_k)]/k$ for any integer $k$ (and any choice of $x_1,\dots,x_k\in \mathbb R$).
The case $k=2^n$ is a straightforward induction.
Now, if $2^{n-1}<k\le 2^n$, then we denote $\overline x=\frac{x_1+\dots+x_k}k$. Now from $$f(\overline x)=f\left(\frac{x_1+\dots+x_k+\overline x+\dots+\overline x}{2^n}\right) \le\frac{f(x_1)+\dots+f(x_k)+(2^n-k)f(\overline x)}{2^n},$$ where $2^n-k$ copies of $\overline x$ are summmed in the middle expression, we get $kf(\overline x) \le f(x_1)+\dots+f(x_k)$ by a simple algebraic manipulation.
The fact that measurability of $f$ is enough for the implication midpoint-convex $\Rightarrow$ convex to hold was mentioned in some of the comments above and in answers to the question I linked. Some references for this fact:
Constantin Niculescu, Lars Erik Persson: Convex functions and their applications, p.60:
H. Blumberg [31] and W. Sierpinski [226] have noted independently that
if $f : (a, b) \to \mathbb R$ is measurable and midpoint convex, then $f$ is also continuous
(and thus convex). See [212, pp. 220.221] for related results.
[31] H. Blumberg, On convex functions, Trans. Amer. Math. Soc. 20 (1919), 40–44.
[212] A. W. Roberts and D. E. Varberg, Convex Functions, Academic Press, New York and London, 1973.
[226] W. Sierpinski, Sur les fonctions convexes mesurables, Fund. Math. 1 (1920), 125–129.
Marek Kuczma: An introduction to the theory of functional equations and inequalities, p.241. He mentions the book T. Bonnesen and W. Fenchel, Theorie der konvexen Körper, Berlin, 1934 as an additional reference.
Is this proof correct? If so, then is my presentation good enough? If not, then where lie the flaws?
The presentation is easy to read and understand. I have corrected the flaws (see my edit of your question). Now the proof is correct, but extremely long, because it consists of a big number of short steps. I don’t have read Rudin, because I learned analysis by old Russian and Ukrainian books, and I don’t know what level of mathematical rigor is required for it, but such detalization level is more like to logical profs than to mathematical that. :-) So you may try to work in formal logic, maybe you’ll like that. :-)
Is the formulation of this result correct and general enough? If so, then is my proof (and the presentation thereof) good enough?
Yes, all is OK.
Is this proof correct? If so, then what is the presentation like?
The proof is correct, the presentation is easy to read and understand.
Is every real convex function $f$ defined in $(a,b)$ also uniformly continuous?
Not necessarily. For instance, a function $f(x)=1/x$ defined on $(0,1)$ is convex, but not uniformly continuous.
Best Answer
Since the author found to numbers $\alpha$ and $\beta$ such that you always have, when $c\leqslant x<y\leqslant d$,$$\frac{f(y)-f(x)}{y-x}\leqslant\alpha$$and$$\frac{f(y)-f(x)}{y-x}\geqslant\beta,$$then the set$$\left\{\frac{f(y)-f(x)}{y-x}\,\middle|\,c\leqslant x<y\leqslant d\right\}$$is bounded and therefore the set$$\left\{\left|\frac{f(y)-f(x)}{y-x}\right|\,\middle|\,c\leqslant x<y\leqslant d\right\}$$is bounded too. So, you can take some $M>0$ such that$$c\leqslant x<y\leqslant d\implies\left|\frac{f(y)-f(x)}{y-x}\right|<M.$$And, since you took $M>0$, there is no need to bother with the possibility that $M=0$.