I'm not sure if there is already an answer to this particular question, but here it goes,
(Definition of convexity that is used here: Let $D \subset \mathbb{R}$ be an (infinite or finite) interval. A function $f:D\longrightarrow \mathbb{R}$ is called convex if for any $x_1,x_2 \in D$ and any $\lambda$ with $0<\lambda<1$,
$$f(\lambda x_1+(1-\lambda)x_2)\leq \lambda f(x_1) + (1-\lambda) f(x_2)$$ is valid )
The following was already proven:
In an interval $I \subset S $ continuous function $f:I \longrightarrow \mathbb{R}$ is then convex if and only if
$(1)$ $$f\bigg(\frac{x+y}{2}\bigg)\leq\frac{f(x)+f(y)}{2} $$ for any $x,y \in I$.
In the proof, the ( -> ) part is almost direct by setting $\lambda=\frac{1}{2}$ into the definition of convexity. But as for ( <- ) I had to use the continuous property of the function, but I wonder if the property $(1)$ stated above actually implies continuity so that the theorem above doesn't need to state the continuity property, as of:
In an interval $I \subset S $ function $f:I \longrightarrow \mathbb{R}$ is then convex if and only if
$(1)$ $$f\bigg(\frac{x+y}{2}\bigg)\leq\frac{f(x)+f(y)}{2} $$ for any $x,y \in I$.
I tried also to find counterexamples but to no avail, as it is for me rather intuitive that the property $(1)$ should imply continuity but I'm not sure, maybe the proof can be similar to the proof of "convexity implies continuity". I would love to see some counterexamples (assuming they exist) or perhaps the proof. Thank you very much in advance!