Let $f(x)$ be continuous in the interval $I=(0,1)$. Define $D_+f(x_0)=\liminf_{h\rightarrow0}\frac{f(x_0+h)-f(x_0)}{h}$. Put $S=\{x\in I:D_+f(x)<0\}$. Suppose that the set $f(I\setminus S)$ does not contain any non-empty open interval. Prove that $f(x)$ is non-increasing.
My attempt: Suppose that $f(x)$ is increasing on $(a,b) \subset (0,1)$, and $a <b$.
This implies $f^{'}(x)>0$ for all $x \in (a,b)$. i.e $D_{+}f(x)>0$ for all $x \in (a,b)$.
Now, $S=(a,b)^c$, and $I \setminus S=I \cap S^c=(a,b)$.
Since, $I\setminus S$ is connected and $f$ is a continuous function. This implies $f(I\setminus S)$ is a connected set. This is a contradiction. Hence $f(x)$ is non increasing on $I$.
Is this attempt correct?