17. Let $f:(0,1) \rightarrow(0,1)$ be a differentiable function with a continuous derivative such that for every positive integer $n$ and odd positive integer $a<2^{n}$, there exists an odd positive integer $b<2^{n}$ such that $f\left(\frac{a}{2^{n}}\right)=\frac{b}{2^{n}}$. Determine the set of possible values of $f^{\prime}\left(\frac{1}{2}\right)$.
Answer: $\{-1,1\}$ The key step is to notice that for such a function $f, f^{\prime}(x) \neq 0$ for any $x$.
Assume, for sake of contradiction that there exists $0\frac{1}{2}$. This contradicts the assumption that $\left|f^{\prime}(x)\right| \leq \frac{1}{2}$ for all $x \in(c, d)$.
Since $f^{\prime}(x) \neq 0$, and $f^{\prime}$ is a continuous function, $f^{\prime}$ is either always positive or always negative. So $f$ is either increasing or decreasing. $f\left(\frac{1}{2}\right)=\frac{1}{2}$ always. If $f$ is increasing, it follows that $f\left(\frac{1}{4}\right)=\frac{1}{4}, f\left(\frac{3}{4}\right)=\frac{3}{4}$, and we can show by induction that indeed $f\left(\frac{a}{2^{n}}\right)=\frac{a}{2^{n}}$ for all integers $a, n$. Since numbers of this form are dense in the interval $(0,1)$, and $f$ is a continuous function, $f(x)=x$ for all $x$.
It can be similarly shown that if $f$ is decreasing $f(x)=1-x$ for all $x$. So the only possible values of $f^{\prime}\left(\frac{1}{2}\right)$ are $-1,1$
Query: if the condition that the derivative is continuous were omitted, would the same result still hold?