# Is $f(x)-\left\lfloor f(x)\right\rfloor$ continuous?

Let $f:[0,1]\to[0,1]$ be a continuous function. Define $h:(0,1)\to[0,1]$ such that, $$h(x)=f(x)-\left\lfloor f(x)\right\rfloor$$Is $h$ continuous? Here $\left\lfloor x\right\rfloor$ is the floor function.

This problem arose due to solving another problem in Real Analysis. Intuitively, it seems that $h$ is continuous but I can neither prove or disprove it. Any help is appreciated.

• Hmmm..... Consider $f(x) = x$. Easy to prove that in this case $h(x)$ is not continuous. To prove something false, you only need one exception, don't you? – Gummy bears Aug 11 '15 at 15:46
• Why do you think it will be continuous? It will be full of dicontinuities, eg the step function x-[x] – Kartik Aug 11 '15 at 15:48
• If $f(x)$ is not constant then in general wherever $f(x)=1$, the continuity could be compromised. – Anurag A Aug 11 '15 at 15:48
• Note that the range of $h$ cannot be $[0,1]$, but $[0,1)$. – Yves Daoust Aug 11 '15 at 16:15

The range of $f(x)$ is known to be $[0,1]$, so that $\lfloor f(x)\rfloor=0$, except where $f(x)=1$, then $\lfloor f(x)\rfloor=1$. So $h(x)$ is $f(x)$, except when $f(x)=1$, then $h(x)=0$ and there is a discontinuity.
Consider $$f(x)=\begin{cases} 2x \, & \text{if} & 0 \leq x \leq 1/2\\ -2x+2 \,& \text{if} & 1/2 < x \leq 1\\ \end{cases}$$ Then $h(x)$ will be discontinuous at $x=1/2$ because $f$ takes the value $1$ at $x=1/2$.
In general, wherever $f$ takes the value $1$, the continuity will be compromised, unless $f$ is the constant function taking the value $1$.