Why such a function is convex? Let $f:(a,b)\rightarrow \mathbb R$ be a continuous function satisfying:
$$ f(x) \leq \frac{1}{2h} \int_{x-h}^{x+h} f(t) dt $$
for all $x,h$ such that $a\leq x-h<x+h \leq b$.
How to show that $f$ is convex?
 A: First, notice that if the given inequality holds, it also holds if $f$ is replaced by $x\mapsto f(x)+cx+d$ (the extra terms contribute equally to both sides).
Now assume that $f$ is not convex, so we can find $a\le\alpha<\beta\le b$ and a $t\in(0,1)$ with $f(t\alpha+(1-t)\beta)>tf(\alpha)+(1-t)f(\beta)$. Modifying $f$ by adding a term $cx+d$, we may assume $f(\alpha)=f(\beta)=0$, and now $f$ is positive somewhere between those points. Let $x\in(\alpha,\beta)$ be a maximum point for $f$ in that interval. The given inequality will imply that $f(t)=f(x)$ for all $t\in[x-h,x+h]$ whenever $[x-h,x+h]\subseteq[\alpha,\beta]$. Picking $h$ as big as possible under that condition, we conclude that either $f(\alpha)$ or $f(\beta)$ equals $f(x)$, which is positive – a contradiction.
A: f(x) <= 1/2h * integral over x-h to x+h f(t) dt
= 2h* f(x) <= integral over x-h to x+h f(t) dt
= 2h*f(x) <= integral over x-h to x f(t) dt + integral over x to x+h f(t) dt
= 2h* f(x) <= h*f(x-h) + h* f(x-h)
= f(x) <= 1/2 * f(x-h) + 1/2 * f(x+h)
= f(0.5(x+h) + 0.5(x-h)) <= 0.5f(x+h) + 0.5f(x-h). ( proved convex )
