Is the image of a nowhere dense closed subset of $[0,1]$ under a differentiable map still nowhere dense? Let $f:[0,1]\to[0,1]$ be a continuous function such that its derivative $f'$ exists on $(0,1)$. My question is:

Q1. If $E\subset[0,1]$ is a nowhere dense closed subset, is $f(E)$ also nowhere dense in $[0,1]$?

If the answer is negative, what will happen when we additionaly assume that $f'\ge 0$ on $(0,1)$?
My question originates from the follow question:

Q2. If $g:[0,1]\to[0,1]$ is the Cantor function, can we find
homeomorphisms $\varphi$ and $\psi$ both from $[0,1]$ to itself, such
that $\psi\circ g\circ \varphi$ is differntiable on $(0,1)$?

If Q1 with the addtional assumption $f'\ge 0$ has a positive answer, then clearly it gives a negative answer to the second question, because for any $\varphi$ and $\psi$, $f=\psi\circ g\circ \varphi$ maps a nowhere dense closed set onto $[0,1]$. Otherwise, I am still interested in whether $\varphi$ and $\psi$ exist or not. Q2 comes from an attempt in providing a simple counter-example to this question for the case $X=Y=(0,1)$.

Update:

*

*Thanks to Henno Brandsma's comment below, I realized to add a remark that Q1 has a positive answer when $f$ is (piecewise) $C^1$.


*Thanks to the discussion with Jim Belk, I realized that my original argument on  Q1 under the assumption that $f$ is $C^1$ was incorrect. The following is a corrected argument.
Denote the Lebesgue measure on $[0,1]$ by $|\cdot|$ and denote $C=\{x\in[0,1]:f'(x)=0\}$. Note that $C$ is a closed. Using the fact that for every closed subset $K$ of $[0,1]$,
$$|f(K)|\le\int_K|f'(x)|dx,$$
or otherwise, we know that $f(C)$ is closed and $|f(C)|=0$, so $f(C)$, and hence $f(C\cap E)$, are closed and nowhere dense. Note that $[0,1]\setminus C$ is a disjoint union of at most countably many intervals, say $[0,1]\setminus C=\sqcup_n I_n$. Note that $f|_{\overline{I_n}}$ is homeomorphic, so $f(\overline{I_n}\cap E)$ is closed and nowhere dense. Then by Baire category theorem,
$$f(E)=f(C\cap E)\cup\big(\cup_n f(\overline{I_n}\cap E)\big)$$
is nowhere dense.


*Moreover, I removed another question similar to Q1 in this post, and  started a new post for it.

Any hint or suggestion is appreciated. Thanks in advance.
 A: The answer to question Q1 is no.  The answer to question Q2 is yes, though it becomes no if we replace "differentiable" with "continuously differentiable".
The key reference is the following:
Dovgoshey, O., et al. “The Cantor function.” Expo. Math. 24 (2006). 1–37
The following theorem appears on pg. 25 of the paper (Proposition 7.5):
Theorem 1. Let $g\colon[0,1]\to[0,1]$ be the Cantor function.  Then there exists a homeomorphism $\varphi\colon[0,1]\to[0,1]$ so that $g\circ\varphi$ is everywhere differentiable, with uniformly bounded derivative.
Immediately afterwards (Proposition 7.6), it is proven that:
Theorem 2. Let $g\colon[0,1]\to[0,1]$ be the Cantor function.  Then there do not exist homeomorphisms $\varphi,\psi\colon[0,1]\to[0,1]$ so that $\psi\circ g\circ\varphi$ is continuously differentiable.
This settles question Q2.  Also, it follows from Theorem 1 that the answer to question Q1 is no.  In particular, if $C$ is the Cantor set, then $C$ is nowhere dense, so $\varphi^{-1}(C)$ is nowhere dense as well.  But the image of $\varphi^{-1}(C)$ under the differentiable function $g\circ\varphi$ is the same as $g(C)$, which is the entire unit interval $[0,1]$.
Of course, this does not address the question of whether the image of a nowhere dense set under a continuously differentiable function is always nowhere dense.  The post linked to by Henno is not entirely convincing, partially because I cannot follow the proof, but mostly because the author seems to retract the proof later in the thread:


*

*Original post (linked to by Henno)

*Reply asking for a simpler proof

*Attempt at a simpler proof, by the same author, in which the author admits a mistake in the first proof.

*The final post, in which the author seems to admit a mistake in the second proof as well, and claims that a counterexample exists. (This is my interpretation, but the post is very unclear.)
Though it's not entirely clear, the conclusion at the end of the thread seems to be that the answer to Q1 is no even in the $C^1$ case.  (Edit: As Landscape and George Lowther point out, there is indeed a simple argument that the answer to Q1 is yes for $C^1$ functions.)
Note that this answer does not conflict with this post, which states that the image of a set of measure zero under a differentiable function has measure zero.  Assuming the post is correct, the inverse image $\varphi^{-1}(C)$ of the Cantor set under the homeomorphism $\varphi$ must have positive Lebesgue measure.  This is of course possible for a nowhere dense set, e.g. the fat Cantor set.
