<s>[INST] Does midpoint-convexity at a point imply midpoint-convexity at other points? This question is a follow-up of this one.
Let $f:\mathbb R \to \mathbb [0,\infty)$ be a $C^{\infty}$ function satisfying $f(0)=0$.
Suppose that $f$ is strictly decreasing on $(-\infty,0]$ and strictly increasing on $[0,\infty)$, and that $f$ is strictly convex in some neighbourhood of $0$.

Given $c \in \mathbb R$, we say that $f$ is midpoint-convex at the point $c$ if
$$
f((x+y)/2) \le (f(x) + f(y))/2,
$$
whenever $(x+y)/2=c$, $x,y \in \mathbb R$.

Question: Let $r<s<0$, and suppose that $f$ is midpoint-convex at $r$. Is $f$ midpoint-convex at $s$?

In the example given here (essentially $(f(x)=-x^3$) $f$ is concave after its global minimum point, while here I assume that there is a convex neighbourhood.
 [/INST] Problem: Let $r < s < 0$ be given. Find a $C^\infty$ function $f : \mathbb{R} \to [0, \infty)$ with $f(0)=0$ such that:
i) $f$ is strictly decreasing on $(-\infty, 0)$ and strictly increasing on $(0, \infty)$;
ii) $f(x) + f(2r - x) \ge 2f(r)$ for all $x\in \mathbb{R}$;
iii) $f(y) + f(2s - y) < 2f(s)$ for some $y \in \mathbb{R}$;
iv) $f$ is strictly convex in some neighbourhood of $0$.
Solution: Let $f(x) = x^4 + bx^3 + cx^2$. Clearly $f(0)=0$.
We claim that $f$ satisfies i), ii), iii) and iv) if
\begin{align}
32c - 9b^2 &> 0, \tag{1}\\
6r^2 + 3br + c &> 0, \tag{2}\\
6s^2 + 3bs + c &< 0. \tag{3}
\end{align}
Indeed, first, we have $f'(x) = x(4x^2 + 3bx+2c)$, and if $32c - 9b^2 > 0$,
then $4x^2 + 3bx+2c > 0$ for all $x\in \mathbb{R}$, so i) is satisfied;
second, we have $f(x) + f(2r-x) - 2f(r) = 2(x-r)^2((x-r)^2 + 6r^2 + 3br + c)$,
and if $6r^2 + 3br + c > 0$, then ii) is satisfied;
third, we have $f(y) + f(2s-y) - 2f(s) = 2(y-s)^2((y-s)^2 + 6s^2 + 3bs + c)$,
and if $6s^2 + 3bs + c < 0$, then iii) is satisfied.
fourth, we have $f''(x) = 12x^2 + 6bx + 2c$, and if $c > 0$ (follows from $32c - 9b^2 > 0$),
then $f''(0) = 2c > 0$ and $f$ is strictly convex in some neighbourhood of $0$ (due to continuity of $f''(x)$).
Then, we prove that there exist $b, c$ such that (1), (2) and (3) are satisfied.
We simply choose $b = -3s$ and
$$c = 3s^2 - \frac{1}{2}\min\left(3(2r-s)(r-s), \ \frac{15}{32}s^2\right).$$
Indeed, first, since $c \ge 3s^2 - \frac{1}{2}\cdot \frac{15}{32}s^2$,
we have $32c - 9b^2 = \frac{15}{2}s^2 > 0$;
second,
since $c \ge 3s^2 - \frac{1}{2} \cdot 3(2r-s)(r-s)$, we have
$6r^2 + 3br + c \ge \frac{3}{2}(2r-s)(r-s) > 0$;
third, since $c < 3s^2$,
we have $6s^2 + 3bs + c < 6s^2 + 3(-3s)s + 3s^2 = 0$.
</s>