# Is it necessary that $f$ is convex on $D$?

Let $$D$$ be a convex set in $$\mathbb{R}^n$$. Suppose there exists some $$a>0, b>0$$ and $$a+b=1$$ such that for any $$x,y \in D$$, the inequality $$f(ax+by) \leq af(x)+bf(y)$$ holds. Is it necessary that $$f$$ is convex on $$D$$? I know when $$a=b$$ it is just the definition of a convex function.

Any help will be appreciated.

• – Robert Z Sep 27 '18 at 5:14

In general the answer is "No". Take any $$f\colon\mathbb{R}^n\to\mathbb{R}$$ which is linear with respect to $$\mathbb{Q}$$ but non linear with respect to $$\mathbb{R}$$. Then there is some real $$a'\in(0,1)$$ and some $$x_0\in\mathbb{R}^n$$ such that $$f(a' x_0)\not=a' f(x_0)$$. We also may assume that $$f(a' x_0)>a' f(x_0)$$ by possibly using $$-x_0$$ instead of $$x_0$$. Then $$f$$ satisfies $$f(ax+by) \leq af(x)+bf(y)$$ with equality for $$a$$ (and also $$b$$) rational. But, using $$b'=1-a'$$, $$f(a' x_0+b' 0)=f(a'x_0)>a'f(x_0)=a' f(x_0)+b'f(0)$$.
Remark: The existence of a mapping $$f$$ being linear with respect to the field of rationals but not linear with respect to the reals may be proved by using a basis of the vector space $$\mathbb{R}^n$$ viewed as a rational vector space.