# Does Density Property assure the continuity of a Non-Contractive Function?

I want to be sure about a detail:

We know that, any contractive function is continuous. Reformulated in other words, any function that does not increase distance is continuous.

But, suppose we are in $$\mathbb{R}$$, and we have a distance increasing function $$f$$ on a subset $$A$$ of $$\mathbb{R}$$. Does the density property of $$A$$ in $$\mathbb{R}$$ guarantee the continuity of this function $$f$$? ie. Will the image of $$A$$ by $$f$$ still be dense in $$\mathbb{R}$$?

No, you can define $$f: \mathbb{R} \to \mathbb{R}$$ by $$f(x) = \frac12 x$$ for $$x \in \mathbb{Q}$$ and $$f(x) = 2x$$ for $$x \notin \mathbb{Q}$$. $$f$$ is contractive on the dense set $$\mathbb{Q}$$ but not on $$\mathbb{R}$$ and nowhere continuous except at $$x=0$$.

• you saying there exists non continuous functions which are contracting too, right? – freehumorist Jan 4 '19 at 23:49
• @freehumorist No, this function is not contracting and it's not continuous. – Henno Brandsma Jan 4 '19 at 23:50
• so how is this an answer to my question? I thought I asked that, when we have a distance-increasing function over a dense set, the continuity would be preserved in the image set too... – freehumorist Jan 4 '19 at 23:53
• @freehumorist we also have here a distance increasing function on the dense irrationals and no continuity. So it does answer that too. BTW Distance increasingness does not imply continuity, decreasingness does (but on the whole domain). – Henno Brandsma Jan 4 '19 at 23:55
• Ok I got your answer. I think I should add another criteria: I want the function to be linear and monotone. Your example amazed me, now that I get; though it is not the answer I wanted. – freehumorist Jan 4 '19 at 23:59