Weakly convex function that is not convex? I’m reading Emil Artin’s introduction on the Gamma function, he proved in Theorem 1.5 that  “a function is convex, if and only if, it is continuous and weakly convex”.
The definition Artin used is:
The difference quotient:  $\varphi(x_1,x_2)=\frac{f(x_1)-f(x_2)}{x_1-x_2}=\varphi(x_2,x_1)$.
$f(x)$ is callled convex (on the interval $(a,b)$) if, for every number $x_3$ of our interval, $\varphi(x_1,x_3)$ is a monotonically increasing function of $x_1$.
We shall call a function defined on an interval weakly convex if it satisfies the inequality $f(\frac{x_1+x_2}2)\leqslant \frac12(f(x_1)+f(x_2))$ for all $x_1, x_2$ of the interval. 
I wonder, if there is a weakly convex function that is not convex?
 A: Sierpinski proved that any real Lebesgue measurable function that is midpoint convex is convex. So it would be necessary to look beyond measurable functions.
A: There exist additive discontinuous maps on $\mathbb R$ If f is such a map then $f(\frac {x+y} 2) =\frac {f(x)+f(y)} 2$ and f is not convex because convex functions are continuous. 
A: See the (?) definition of weakly convex:
Weakly convex functions are convex
$f$ is weakly convex if for every $C_0^\infty$ function $\phi \geq 0$ that $$\int f(x)[\phi(x+h) + \phi(x-h) - 2\phi(x)]dx \geq 0
$$ for all $h \in \mathbb{R}$. Let $\phi^h(x) = \phi(x+h) + \phi(x-h) - 2\phi(x)$. Without loss of generality, suppose that $\phi \neq 0$ identically and then rescale so that $\int \phi = 1$.
A convex function on $\mathbb{R}$ is always continuous, so our weakly convex function that is not convex would need to be not continuous.
We then see that since it is defined in terms of an integral, that a function is still weakly convex if one changes it on a set of measure zero (or, if you are not familiar with measure theory, also any finite or countable set). The requirement of continuity precludes changing the function on a set of measure zero without "messing up" the integral. For instance, $\chi_{\mathbb{Q}}$ is weakly convex, but not continuous.
If you were looking for an example that is not "essentially" continuous, meaning that it is really just a continuous function that has been modified on a set of measure zero, then I don't think that there are any, but I can't prove it.
If one means weakly convex in terms of what the other person answering this question is defining it: $f(x/2 + y/2) \leq f(x)/2 + f(y)/2$, then one has to go no farther than the famous $\mathbb{Q}$-linear function from $\mathbb{R}$ to $\mathbb{R}$ that is not continuous. See: https://en.wikipedia.org/wiki/Discontinuous_linear_map#General_existence_theorem
using the axiom of choice.
