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]$.


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'$).

  • 1
    $\begingroup$ A differentiable function is convex on an interval iff its derivative is increasing, that should be of help. By the way, $\mathbb Q\cap[0,1]$ is not compact. $\endgroup$
    – Wojowu
    Commented Dec 6, 2018 at 14:57
  • $\begingroup$ I don't have time to think about this now, but maybe something I wrote in this 14 June 2001 ap-calculus post archived at Math Forum will help. $\endgroup$ Commented Dec 6, 2018 at 16:05
  • 1
    $\begingroup$ It appears that all the results I state in that 2001 post start from the assumption of convexity and then ask how well behaved MUST the function be and how pathological CAN the function be, but you're starting from convexity at no point and asking how well behaved CAN the function be. Maybe the references I give in that post will be of use. I'd recommend looking at Garg's book, because if it's known at all, it's probably there, although it's likely to be in such a specialized-general way that you might have difficultly recognizing it. $\endgroup$ Commented Dec 6, 2018 at 16:18
  • $\begingroup$ @Wojowu: Yes, we can use such characterisation of convexity. Since there exist everywhere differentiable and nowhere monotone function mathoverflow.net/questions/167323/… we can integrate it, and we get nowhere convex and nowhere concave function of class ${\rm C}^1$. But the quaestion still remains: can we have such twice differentiable or even ${\rm C}^2$ function? $\endgroup$
    – Andrija
    Commented Dec 6, 2018 at 18:27
  • $\begingroup$ @Wojowu: I made the statement about ${\rm Q}\cap [0,1]$ more precise. $\endgroup$
    – Andrija
    Commented Dec 6, 2018 at 18:32

1 Answer 1


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.$

  • $\begingroup$ Thanks a lot. Q1 and Q2 are very different cases, though. If I may ask you: Do you agree that, as a consequence of Q1, every ${\rm C}^2[0,1]$-function is convex/concave on $(0,1)$, with at most countably many convexity/concavity intervals, and at most countably many inflection points? This sounds obvious to me. Is it really so? $\endgroup$
    – Andrija
    Commented Dec 6, 2018 at 19:42
  • 1
    $\begingroup$ I added to my answer to answer your question. $\endgroup$
    – zhw.
    Commented Dec 8, 2018 at 16:50
  • $\begingroup$ I thank you again. This is a very good example. Just to be safe, here by "an inflection point", we mean the point in which the tangent line intersects the graph of ${\rm C}^1$-function, see en.wikipedia.org/wiki/Inflection_point $\endgroup$
    – Andrija
    Commented Dec 9, 2018 at 11:06
  • $\begingroup$ Yes you're right. In every interval containing a point of $K,$ my example exhibits strict convexity somewhere, and strict concavity somewhere. I guess that doesn't show every point of $K$ is an inflection point. Let me think about this. $\endgroup$
    – zhw.
    Commented Dec 9, 2018 at 23:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .