Proving continuity of a function that satisfies Cauchy functional equation and is bounded on an interval. Suppose that $f: \mathbb R\to \mathbb R$ is a function that satisfies Cauchy’s functional equation that is, $f(x+y)=f(x)+f(y)$ for all $x,y\in \mathbb R$.
It can be shown that there exists some constant $c$ such that $f(x)=cx$ for all $x\in \mathbb Q$.
Now, one theorem says that if $f$ is bounded on $(a,b), b\gt a$, then $f$ is continuous on $\mathbb R$.
I want to prove this theorem. One proof I know goes along these lines: Define $g(x)=f(x)-cx$ for all $x\in \mathbb R$.
Now $g(x+r)=g(x)$ for all $x\in \mathbb R$ and for all $r\in \mathbb Q$. For any $x\in \mathbb R$ we can choose a rational number $r$ such that $x+r\in (a,b)$ and hence it follows that $g$ is bounded on $\mathbb R$. Now, $g$ can’t be non zero at a point as if $g(t)$ is non zero for some $t$ then $g(nt)=ng(t)$ shows that $g$ increases/decreases without bound hence resulting in contradiction. So $f(x)=cx$ for all $x\in \mathbb R$. Hence the result follows.
But I was wondering if the following could work: Suppose that f is not continuous at some $q\in (a,b)$. It follows that there is a sequence $(x_n)$ in (a,b) such that $(x_n)$ converges to $q$ and that $f(x_n)$ doesn’t converge to $cq$.
Since f is bounded, $f(x_n)$ has a convergent subsequence $f(x_{n_k})\to s$ where $s\ne cq$. But I am stuck here. Any help in proceeding further is much appreciated. Thanks.
 A: I think the attempt you've made in your question can go further , it's correct as written but can go further.

 I see that you have a deleted answer which contains an attempt : you will have deleted it for some reason, but I can view it, and from what I can see, the statement  "for every sequence of rationals $r_q$, it must be true that $f(r_n) \to cq$" might require more justification. I think you used the functional equation somewhere, but it's not clear to me.

Nevertheless, this is what I can contribute : the concept of mid-convexity is important for theoretical reasons, since it can be converted to proper convexity under the smallest of hypotheses, and hence is a great tool for proving convexity, which as a consequence provides continuity and the existence of subdifferentials for  multivariable functions.

Where does convexity get involved at all in Cauchy's functional equation though? The answer comes from noticing that for any $x,y$ we have $x+y = \frac{x+y}{2} + \frac{x+y}{2}$ and therefore, the functional equation we have gives :
$$
f(x)+f(y) =2 f\left(\frac{x+y}{2}\right)
$$
following which our analysis begins.

Mid-convexity

A function $f: A \subset \mathbb R^n \to \mathbb R$ is called mid-convex if $f(x)+f(y) \geq 2 f(\frac {x+y}2)$ for all $x,y \in A$ with $\frac{x+y}{2} \in A$. It is called convex if for all $\lambda  \in [0,1]$ and $x,y \in A$ with $(1-\lambda)x + \lambda y \in A$, it is true that $f((1-\lambda)x+\lambda y)\leq (1-\lambda)f(x)+\lambda f(y)$. If , for a fixed $\lambda \in [0,1] $ we have the above assertion for all $x,y \in A$, then $f$ is called a $\lambda$-convex function.

Note that a midconvex function is just a $\frac 12$-convex function. We will now state and prove a refined form of Theorem 12.2 of the document here. It is an otherwise very rewarding document to read as well , for anyone interested in real analysis. It contains an application of the above principle to operations preserving total positivity of matrices.

Suppose that $f$ is mid-convex on some convex domain. Then $f$ is convex if and only if  $f$ is bounded above on some open subinterval of the set.

A stronger result replaces being upper bounded on an open subinterval by being upper bounded on a measurable subset (this result is for $n=1$).
To prove this, we use a result that doesn't use anything about $f$ except it's mid-convexity, so that the boundedness assumption can be fed in very nicely.

Suppose that $f$ is $\frac 12$ convex. Then $f$ is $r$ convex for any $r \in (0,1) \cap \mathbb Q$.

Proof : Note that if $x_1,x_2,x_3,x_4$ are any four quantities, then $$
f\left(\frac{x_1+x_2+x_3+x_4}{4}\right) = f\left(\frac{\frac{x_1+x_2}{2} + \frac{x_3+x_4}{2}}2 \right) \\ \leq \frac 12f\left(\frac{x_1+x_2}{2} \right) + 2\left(\frac{x_3+x_4}{2} \right) \leq \frac 14 [f(x_1) + f(x_2)+f(x_3)+f(x_4)]$$
In inductive fashion, it is thus possible to prove that $$
\frac{f(x_1)+...+f(x_{2^n})}{2^n} \geq f\left(\frac{x_1+...+x_n}{2^n}\right)
$$
for all $n \geq 1$ and all $x_1,...,x_{2^n}$ in the domain. Let $r = \frac pq$ be rational with $0<p<q$. Let $x_1,...,x_q$ be in the domain, and let $n$ be the unique integer such that $2^{n-1} \leq q < 2^n$. We define $\bar x = \frac{x_1+\ldots+x_q}q$. Now, use the result above with $2^n$ and with $x_{q+1}=\ldots = x_{2^n} = \bar{x}$ to get :
$$
f\left(\frac{\sum_{i=1}^{q} x_i + (2^n-q)\bar{x}}{2^n}\right) \leq \frac{\sum_{i=1}^q f(x_i)+(2^n-q)f(\bar{x})}{2^n}
$$
But $\sum_{i=1}^{q} x_i = q \bar{x}$, therefore
$$
\frac{\sum_{i=1}^{q} x_i + (2^n-q)\bar{x}}{2^n} = \frac{q\bar{x} + (2^n-q)\bar{x}}{2^n} = \bar{x}
$$
and therefore rearranging the main statement gives us
$$
f(\bar{x}) \leq \frac{\sum_{i=1}^n f(x_i)}{q}
$$
Now, fix an $x,y$ in the domain. Set $p$ of the $x_i$ to equal $x$ and $q-p$ of them to equal $y$, and you will automatically get $f(rx + (1-r)y) \leq rf(x) + (1-r)f(y)$, as desired. $\blacksquare$
Now we begin the proof of the first equality. We can without assume that the subinterval in question is $(x_0-\delta,x_0+\delta)$ for some $x_0$ and $\delta>0$. We begin with the claim that $f$ is actually continuous at $x_0$.
To prove this, suppose that $f(y)<M$ for all $|y-x_0|<\delta$. Let $\epsilon \in (0,1) \cap \mathbb Q$ be rational and $|y-x_0| < \epsilon\delta$. We have :
$$
y = \epsilon z + (1-\epsilon) x_0
$$
for some point $z$ which can be computed from the above equation as $z = \frac{y-(1-\epsilon)x_0}{\epsilon}$. Note that $|z-x|<\epsilon$, one can check this from the formula. But then, using $\epsilon$ convexity of $f$ we have :
$$
f(y) \leq \epsilon f(z) + (1-\epsilon) f(x_0) \leq \epsilon M + (1-\epsilon) f(x_0)
$$
and thus$$
f(y)-f(x_0) \leq \epsilon(M-f(x_0))
$$
Now, we use $\frac{\epsilon}{1+\epsilon}$ (which is rational and in $(0,1)$ if $\epsilon$ is!) convexity as follows : Note that$$
x = \frac{\epsilon}{1+\epsilon}z' + \frac{y}{1+\epsilon}
$$
for some $z'$ that can be calculated as $z' = \frac{(1+\epsilon)x-y}{\epsilon}$. Once again, note that $|f(z')-f(x)|<\epsilon$. Thus, we get $$
f(x) \leq \frac{\epsilon}{1+\epsilon}f(z') + \frac{f(y)}{1+\epsilon} \leq \frac{\epsilon M}{1+\epsilon} + \frac{f(y)}{1+\epsilon}
$$
and thus, $$
f(y)-f(x) \geq \frac{2\epsilon M}{1+\epsilon}
$$
which gives, for $|y-x|<\epsilon \delta$,
$$
|f(y)-f(x)| \leq \max\left\{\epsilon(M-f(x_0)), \frac{2\epsilon M}{1+\epsilon}\right\}
$$
as $\epsilon \to 0$, the right hand side converges to zero. An easy $\epsilon-\delta$ (change the variables to something else now, I implore!) type argument will do the rest. Thus, $f$ is continuous at $x_0$.
However, note that if $|y'-x|<\delta$ then it is also true that $f$ is bounded in the region $\{|y-y'| < \frac{\delta - |y'-x|}{2}\}$, and we can repeat the same argument to get that $f$ is continuous at $y_0$. We have in fact proven that :

If $f$ is bounded in some interval, then it is continuous on that interval.

Which can be used in isolation to solve your question : but we need to go further because we only know boundedness on $|y-x|<\delta$, right? We will prove now, that $f$ is bounded at a neighbourhood of every point and use the result to deduce that $f$ is continuous everywhere.
To do this, let $y$ be any other point and let $\rho>1$ be a rational number appropriately chosen close to $1$. We will now prove that $f$ is bounded on $|y'-y|< \left|\frac{x-\delta(\rho-1)}{\rho}\right|$. Let $y'$ be in this set. We write :
$$
y' = y-x + \left(\frac{\rho-1}{\rho}\right)z = \frac{1}{\rho}[\rho(y-x)] + \left(\frac{\rho-1}{\rho}\right)z
$$
for some point $z$ that can be calculated as $z = \frac{\rho(y'-y+x)}{\rho-1}$. We can verify that $$
|z-x| < \frac{\rho(y'-y)}{\rho-1} + \frac{x}{\rho-1} < \delta
$$
Using $\frac 1{\rho}$ convexity and the bound $M$ gives $$
f(y') \leq \frac{f(\rho(y-x))}{\rho} + \frac{M(\rho-1)}{\rho}
$$
which is a constant independent of $y'$. Thus, you can conclude that $f$ is bounded on some neighbourhood of $y$. Hence, $f$ is continuous at $y$, and hence continuous everywhere.
Now, once $f$ is continuous everywhere, it's easy to see why f is convex. Let $\lambda \in [0,1]$ and let $r_n$ be a sequence of rationals converging to $\lambda$. Let $x,y$ be any two points. We know by $r_n$ convexity for all $n$ that
$$
f(r_n x + (1-r_n)y) \leq r_n f(x) + (1-r_n)f(y)
$$
merely letting $n \to \infty$ and using continuity tells us that $f(\lambda x + (1-\lambda)y) \leq \lambda f(x) + (1-\lambda)f(y)$, as desired. $\blacksquare$

Solving our problem
In our problem, we are done because once we know that $f(x)+f(y) = f(x+y)$ and $f$ is bounded, then we know that $f$ is midconvex and bounded in an interval, and hence continuous in that interval. Then we can proceed in the usual way (prove that $f(\frac pq) = \frac pq f(1)$ for all $p, q>0$ and use continuity).

What about $\lambda$-convexity?
We actually have something unbelievably fascinating around $\lambda$-convexity.

Any $\lambda$-convex function for $\lambda \in (0,1)$, is midconvex!

This was always shocking to me, is shocking even today. Here's a proof from the paper "On $t$-convexity" by Nikodem and Páles.
Let $x<y$ be in the domain. We create three points like so :
$$
x_1 = tx + (1-t)\frac{x+y}{2} , x_2= \frac{x+y}{2} , x_3 = t\frac{x+y}{2} + (1-t)y 
$$
We actually have the following relations that can easily be checked :
$$
x_1 = tx + (1-t)x_2 \\
x_2 = (1-t)x_1 + tx_3 \\
x_3 = tx_2 + (1-t)y
$$
and following this, we can write :
$$
f(x_2) \leq (1-t)f(x_1) + tf(x_3) \leq (1-t)(tf(x) + (1-t)f(x_2))+t(tf(x_2) + (1-t)f(y))
$$
which simplifies following cancellations to $2f(x_2) \leq f(x)+f(y)$, as desired!
This therefore proves the more general statement :

If $f$ is $t$-convex for $t \in (0,1)$ then $f$ is convex if and only if it is bounded above in some open set.

This technique can be used to tackle the "sister" Cauchy equations such as $f(\frac{x+2y}{3}) = \frac{1}{3}f(x)+\frac{2}{3}f(y)$ and so on. For each of these equations, it is then clear that if any solution is locally bounded in some neighbourhood, it must be of the form $cx$ for some $c$.
