My textbook is asking to construct such a function, but this thread seems to say that's not possible. What am I missing here? I want to construct a function that's not differentiable for $x=c$, for any $c$ in the interval.
-
2Nowhere differentiable is not the same as being non-differentiable on a dense set. – Xander Henderson Nov 29 '18 at 14:00
-
1Maybe one can do something similar to the Devil's staircase? – Arthur Nov 29 '18 at 14:14
-
@Arthur The Cantor function is only non-differentiable on the Cantor set, which is not dense in $\mathbb{R}$. – Xander Henderson Nov 29 '18 at 14:20
-
@XanderHenderson Which is why I didn't post it as an answer. I don't even know if the approach is possible to adapt to a dense set. – Arthur Nov 29 '18 at 14:23
-
@bob Can you tell from which book you found this excercise? – Curious student Nov 29 '18 at 14:58
-
@Shubham Understanding Analysis, Abbott, 2nd edition – bob Nov 29 '18 at 15:05
1 Answers
The question to which you have linked discusses the impossibility of constructing a function that is continuous, monotone, and nowhere differentiable. However, you are not being asked to construct such a function. You are being asked to construct a continuous, monotone function which is non-differentiable on a dense subset of $\mathbb{R}$.
My goto example of such a function is a function which has a little "jump" at each rational number. To build such a function, start by defining $$ f(x) = \begin{cases} 1 & \text{if $x \ge 0$, and} \\ 0 & \text{otherwise.} \end{cases} $$ This function has a jump discontinuity at zero.
Next, observe that the rational numbers are countable, which implies that there is a bijection $q : \mathbb{N} \to \mathbb{Q}$ which provides an enumeration of $\mathbb{Q}$. Let $q_n := q(n)$ for each $n\in\mathbb{N}$. At each $n$, we are going to define a function $f_n$ which has a jump discontinuity at $q_n$. In order to ensure that the function we get doesn't "blow up", we are going to build the jumps in such a way that they get small relatively quickly. Specifically, define $$ f_n(x) := \frac{f(x-q_n)}{2^n}. $$ If you prefer something more explicit, note that $$ f_n(x) = \begin{cases} 2^{-n} & \text{if $x \ge q_n$, and} \\ 0 & \text{otherwise.} \end{cases} $$
Because we have chosen the jumps in such a way that they get small fast, we can sum all of these functions and get something that converges. So define $$ g(x) = \sum_{n=1}^{\infty} f_n(x). $$ It is not too hard to show that this function converges pointwise and has a discontinuity at every rational number.
Finally, as per the hint in your homework, define $$ G(x) = \int_{a}^x g(x)\,\mathrm{d}x. $$ As per the quoted text, $G$ is not differentiable at any rational number.
Note that I have left out quite a few details which you should fill in. You should make sure that you understand why $\mathbb{Q}$ is countable and dense in $\mathbb{R}$ (unless these are facts that you are allowed to take for granted). You should also check that $g$ really is discontinuous at each rational, and you should make sure that you understand why the series defining $g$ actually converges. Finally, it might be a good idea to build $G$ a little more carefully so that it is more artfully restricted to the interval of interest, i.e. the interval $[a,b]$.
EDIT: As per the comment left below by Dave L. Renfro, these kinds of results can be pushed farther to obtain, for example, Lipschitz continuous monotone functions which are non-differentiable on a dense subset of $\mathbb{R}$. The relevant discussion is contained in this answer to another question on MSE.

- 29,772
-
Regarding how far such examples can be pushed that also satisfy an additional restriction (namely, being Lipschitz continuous), see my answer to Monotone Function, Derivative Limit Bounded, Differentiable - 2. – Dave L. Renfro Nov 29 '18 at 15:09
-