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