# An increasing function that is nowhere convex

I was looking for an example of a function $f:\mathbb R\to\mathbb R$ that satisfies $x<y$ implies $f(x)\le f(y)$ but is nowhere convex in the sense that for all $x\in\mathbb R$ there does not exist a set $E$ containing $x$ such that $f|_E$ is convex.

I thought a function that was some kind of "fractal" staircase would provide an example of such a function, but I am not sure how to write down its definition. If such a function does not exist, I would like a sketch of a proof that it does not exist.

For context, I was just drawing some graphs of increasing functions and noticed that of the few I drew, these functions weren't convex, but they appeared to be convex locally.

• do you also want to function to stay always positive? – clark Apr 30 '17 at 15:37
• @clark No, not necessarily. That would be interesting, however. The more irregular the example, the better. – Alex Ortiz Apr 30 '17 at 15:39

The function $f(x)=-e^{-x}$ is nowhere a convex function but it is increasing.