The author proves that the inequalities $f((a+ b)/2)\leq\Biggl(\int^b_a f(x)dx\Biggr)/(b-a)\leq (f(a)+ f(b))/2,$ well known for convex functions, hold in fact for some larger classes of functions and for functionals more general than integrals.