Does there exist a smooth function which is nowhere convex/concave

convex-analysisexamples-counterexamplesreal-analysis

Consider $g\in {\rm C}^1[0,1]$. We say that $g$ is nowhere convex (concave, resp.) on $[0,1]$ if there is no open interval $I\subseteq [0,1]$ on which $g$ is convex (concave, resp.) Is it possible to find a function $g$ which satisfies:

Q1.(strong verison) $g$ is ${\rm C}^2[0,1]$ and $g$ is nowhere convex and nowhere concave on $[0,1]$?

Q2.(weak version) $g$ is twice differentiable on $(0,1)$ and $g$ is nowhere convex and nowhere concave on $[0,1]$?

I suspect that the answer to Q1 is no, and that the answer to Q2 is yes, but I am not exactly sure how to prove it. The question may be related to questions about sets of zeros of the first (or, equivalently, the second) derivative of $g$. By Whitney's Theorem, we can find ${\rm C}^{\infty}$-function whose first (or equivalently, second) derivative vanishes exactly on any given compact subset of $[0,1]$.

https://mathoverflow.net/questions/179445/non-zero-smooth-functions-vanishing-on-a-cantor-set

There are examples which show that $g'$ can be zero on the set ${\bf Q}\cap [0,1]$,

Set of zeroes of the derivative of a pathological function

so the elementary sufficient condition $g''>0$ for strict convexity does not apply in our case because every open interval contains at least one rational point. This however, in my view, does not discount the possibility that $g$ is (not necessarily strictly) convex in such intervals (g'' can occasionally be zero, and g still can be convex). Also, Darboux property of $g''$:

Is intermediate value property equivalent to Darboux property?

or existence of nowhere monotone continuous function $g'$ may be related to the answer:

Suppose a continuous function $f:\mathbb{R} \rightarrow \mathbb{R}$ is nowhere monotone. Show that there exists a local minimum for each interval.

the point here being that a point of strict inflection of $g$ is exactly the point of strict local extremum of $g'$,

Does there exist a continuous function from [0,1] to R that has uncountably many local maxima?

but I am not sure whether we can use the same argument if we consider general inflection point of $g$ (i.e., non-strict local extremum of $g'$).

Best Answer

Q1: The answer is no. If $g''(a)>0$ for some $a\in [0,1],$ then $g''>0$ in a neighborhood of $a$ by the continuity of $g''.$ Hence $g$ is strictly convex in that neighborhood. Similarly, if $g''(a)<0$ for some $a\in [0,1],$ then $g$ is strictly concave in that neighborhood. We're left with the case $f''\equiv 0.$ But this implies $f(x) = ax +b$ on $[0,1],$ hence $f$ is both convex and concave everywhere on $[0,1].$


Added later, in answer to the comment: It's actually possible for a $C^2$ function to have uncountably many inflection points. Suppose $K\subset [0,1]$ is uncountable, compact, and has no interior (the Cantor set is an example). Define

$$f(x)=\begin{cases}d(x,K)\sin (1/d(x,K)),&x\notin K\\ 0,& x\in K\end{cases}$$ Then $f$ is continuous, and $f$ takes on positive and negative values on any interval containing a point of $K.$ Define

$$g(x)=\int_0^x\int_0^t f(s)\,ds\,dt.$$

Then $g\in C^2[0,1]$ and $g''=f.$ It follows that every point of $K$ is an inflection point of $g.$

Related Question