I am attempting the following problem from Pugh's Real Mathematical Analysis (p. 206):
Assume that $\psi:[c, d]\rightarrow[a, b]$ is continuously differentiable. Let $C = \{x\in[c, d]: \psi'(x) = 0\}$ denote the set of critical points of $\psi$. Prove that if $f\circ \psi$ is Riemann integrable for each Riemann integrable $f$ on $[a, b]$, then the set of critical points of $\psi$ is of measure zero.
Hint: Think in terms of the Morse-Sard Theorem which states that if $\psi:[c, d]\rightarrow\mathbb{R}$ is continuously differentiable and $C$ denotes the set of critical points of $\psi$ then $\psi(C)$ has measure zero.
The result is obviously false if $\psi$ is constant so let us assume that $\psi$ is non-constant (Pugh did not mention this).
Ideas:
While trying various things I observed the following: if $Y$ is any subset of $[a, b]$ such that $\chi_{Y}$ is Riemann integrable then noting that $\chi_{Y}\circ \psi = \chi_{\psi^{-1}(Y)}$ is Riemann integrable on $[c, d]$, for any subinterval $[c_{1}, d_{1}]$ of $[c, d]$ we have $$\int_{c_1}^{d_1}\chi_{\psi^{-1}(Y)}(x)\psi'(x)\:\text{d}x = \int_{c_1}^{d_1}\chi_{Y}(\psi(x))\psi'(x)\:\text{d}x = \int_{\psi(c_1)}^{\psi(d_1)}\chi_{Y}(t)\:\text{d}t = m(Y\cap[\psi(c_1), \psi(d_1)]).$$ (Note that the change of variables formula being used here is quite a general one which only requires the Riemann integrability of $\chi_{Y}$ (and in particular does not require it to be continuous). A proof may be found here.)
I also noted that since $m(\psi(C)) = 0$, we can cover $\psi(C)$ by finitely many intervals, the sum of whose lengths is less than some positive number $\varepsilon$ (since $\psi(C)$ is compact). My idea was to use these facts to estimate the integral $$\int_{c}^{d}\chi_{C}(x)\:\text{d}x = m(C),$$ but I've not had any luck so far. I would appreciate it if someone could help me solve this problem.
Edit: Here is another observation: we note that $\psi(C)$ can contain no interval since $m(\psi(C)) = 0$. Therefore, $\psi(C)$ equals its boundary and since it is of measure zero, $\chi_{\psi(C)}$ is Riemann integrable on $[a, b]$. By hypothesis, this implies that $\chi_{\psi^{-1}(\psi(C))}$ is Riemann integrable on $[c, d]$.
Further edit: Note that $m(\text{boundary}(\psi^{-1}\psi(C))) = 0$. We may write $(c, d)-C$ as a countable disjoint union of open intervals. Let $(p, q)$ be one such interval and note that it can be written as a countable union of closed intervals $(p, q) = \bigcup_{n = 1}^{\infty}[p_{n}, q_{n}]$. The restriction of $\psi$ to any such interval $[p_{n}, q_{n}]$ is a $\mathcal{C}^{1}$ diffeomorphism and thus $$\forall n\:\:m(\psi^{-1}(\psi(C))\cap[p_{n}, q_{n}]) = 0\implies m(\psi^{-1}(\psi(C))\cap(p, q)) = 0.$$ Thus, $m(\psi^{-1}(\psi(C))-C) = 0$. Now let us assume that $C$ is nowhere dense. We show that every point of $C$ is a boundary point of $\psi^{-1}(\psi(C))$. Let $x\in C$ and $(r, s)$ be an open interval containing $x$. Since $C$ is nowhere dense, $(r, s)$ must intersect one of the intervals in the complement of $C$, say $I = (r, s)\cap(p, q)\neq\varnothing$. But since $m(\psi^{-1}(\psi(C))\cap(p, q)) = 0$ as shown above, the interval $I$ must intersect $(p, q)-\psi^{-1}(\psi(C))$, which shows that $x$ is a boundary point of $\psi^{-1}(\psi(C))$. Therefore, $$C\subseteq\text{boundary}(\psi^{-1}(\psi(C)))\implies m(C) = 0.$$
Thus, we only need to show that if $C\neq [c, d]$ then $C$ must be nowhere dense.