<s>[INST] Upper bound of non-negative concave function on interval 
Let $f(x)$ be a non-negative and upper convex (concave) function
defined on the interval $[a,b]$. Suppose
$f\left(\frac{a+b}{2}\right)\leq2$. Show that $f(x)\leq4$ for all
$x\in[a,b]$.

How can I show the statement above? Note that we do not assume $f$ being continuous or differentiable.
I can't come up with any trick rather than either to use a non-negativity like
$$f(x)\leq f(x) + f\left(\frac{a+b}{2}\right)\leq f(x) + 2f\left(\frac{a+b}{2}\right)\leq f(x) + 4$$
or to use a subadditivity along the lines of
$$f\left(x+\frac{a+b}{2}\right)\leq f(x) + f\left(\frac{a+b}{2}\right)\leq f(x) + 2$$
which doesn't lead to the desired upper bound. A complete solution or at least a hint will be appreciated.
 [/INST] In the case $\frac{a+b}{2} \le x \le b$ we can use the concavity condition for $a < \frac{a+b}{2} < x$, which gives
$$
 2 \ge f(\frac{a+b}{2}) \ge \frac{x-(a+b)/2}{x-a}f(a) + \frac{(a+b)/2-a}{x-a} f(x) \, .
$$
Now use that $f(a) \ge 0$ and $x-a \le b-a$.
Graphically: Let $l$ be the line joining $(a, f(a))$ and $(\frac{a+b}{2}, f(\frac{a+b}{2}))$. Then $f(x) \le l(x) \le 4$ for $\frac{a+b}{2} \le x \le b$.
The case $a \le x \le \frac{a+b}{2}$ works similarly, or can be reduced to the first case because of the symmetry of the problem.
</s>