Monotone functions and non-vanishing of derivative

It's clear that $A$ must have empty interior. At least for closed sets that's a characterization:

Theorem If $A\subset[0,1]$ is compact with empty interior then there exists a strictly increasing $f\in C^1([0,1])$ such that $A$ is the zero set of $f'$.

Exercise Modify the following proof to show that we can even get $f$ infinitely differentiable.

Proof. Say the connected components of $[0,1]\setminus A$ are $I_1,\dots$. Each $I_n$ is a relatively open interval; there exist $a_n$, $b_n$ with $$I_n\cap(0,1)=(a_n,b_n).$$

Choose $f_n\in C^1(\Bbb R)$ so that $f_n(t)=0$ for all $t\le a_n$, $f(t)=1$ for all $t\ge b_n$, and $f_n'(t)>0$ for all $t\in(a_n,b_n)$. Choose $c_n>0$ so that $$\sum_n c_n\sup_t(|f_n(t)|+|f_n'(t)|)<\infty,$$and let $$f=\sum_n c_nf_n.$$The hypothesis implies that $$f'=\sum_nc_nf_n',$$so $f$ is continuously differentiable and $$\{t\in[0,1]:f'(t)=0\}=A.$$And $f$ is strictly increasing: Say $0\le x<y\le 1$. Since $A$ has empty interior there exists $t\in(x,y)$ with $f'(t)>0$. QED


On $[0,1]$, consider $$ \frac{\mathrm{d}}{\mathrm{d}x}\frac x{1-x\sin\left(\frac1x\right)}=\frac{1-\cos\left(\frac1x\right)}{\left(1-x\sin\left(\frac1x\right)\right)^2} $$