# convex with generic function

Given: $f(px+(1-p)y)\le pf(x)+(1-p)f(y)$

Suppose $f(x)$ is defined on the interval I. If $x_{1}<x_{2}<x_{3}$ are in I and $f(x_{1})<f(x_{2})$ and $f(x_{3})<f(x_{2})$, then show that $f(x)$ is not convex on I.

Not sure where to begin on this one

-

First express $x_2$ as a weighted linear combination of $x_1$ and $x_3$ i.e. $x_2 = tx_1 + (1-t)x_3$ such that $0 < t <1$. This is always possible since $x_2$ lies on the line segment connecting $x_1$ and $x_3$.
Now if $f(x)$ is convex in the interval $[x_1,x_2]$, then $f(x_2) = f(tx_1 + (1-t)x_3) < tf(x_1) + (1-t)f(x_3)$. But we are given $f(x_1) < f(x_2)$ and $f(x_3) < f(x_2)$. And hence $tf(x_1) + (1-t)f(x_3) < t f(x_2) + (1-t) f(x_2) = f(x_2)$.
So, we get $tf(x_1) + (1-t)f(x_3) < f(x_2)$ which contradicts the fact that $f$ is convex on the interval.
What you say is "given" is actually the definition of convex, which you want to show does not hold for any $f$ with the property given subsequently. The convexity property says that the function value at a point between $x_1$ and $x_3$ has to be less than or equal to a certain weighted average of the values $f(x_1)$ and $f(x_3)$. This is impossible if the in-between value is larger than the endpoint values.