While studying for my optimization class, I came across the following problem:
Problem: Prove that if a function $f$ defined on an open interval $I \subseteq \mathbb{R}$ is convex, then $f$ is continuous. Must a convex function on an arbitrary interval be continuous?
I have seen proofs regarding this fact before, like this one: Is every convex function on an open interval continuous? which is fine and I was able to grasp.
However, the book I am using ("A Problem book in Real Analysis"), gives a slightly different proof containing an inequality which is bothering me a lot:
Proof:
Let $I=(a, b)$ be an open interval and assume $f$ is convex on $(a, b)$. Let $c \in(a, b)$. Suppose $a<s<c<d<t<b$. From the geometric interpretation of convexity, we know that the point $(c, f(c))$ lies below the line through the points $(s, f(s))$ and $(d, f(d))$. That is, $$ f(c) \leq f(s)+\frac{f(d)-f(s)}{d-s}(c-s) . $$ Now consider the line through the points $(c, f(c))$ and $(t, f(t))$. Again from convexity we have $$ f(d) \leq f(c)+\frac{f(t)-f(c)}{t-c}(d-c) . $$
The author continues and states that:
From the above inequalities we can obtain $$ f(s)+\frac{f(c)-f(s)}{c-s}(d-s) \leq f(d) \leq f(c)+\frac{f(t)-f(c)}{t-c}(d-c) . $$
Which I just cannot see why the LHS should be true, that is, why $$f(s)+\frac{f(c)-f(s)}{c-s}(d-s) \leq f(d)$$ holds.
Attempt:
Apparently, one should be able to conclude the above inequality from the previous two, as the authors says:
From the above inequalities one can obtain...
Having that in mind, I tried summing the inequalities, but ended up with $$ f(d) \leqslant f(s)+\frac{f(d)-f(s)}{d-s} \cdot(c-s)+\frac{f(t)-f(c)}{t-c} \cdot(d-c) $$
which is no good. I also tried to reverse engineer the inequality, but it did not go so well. I also tried using the geometric interpretation of convexity, but the endpoints in the LHS inequality do not seem to agree.
Can someone help?
Thanks in advance, Lucas