# Is there an everywhere discontinuous increasing function?

Does there exist a function $f : \mathbb{R} \rightarrow \mathbb{R}$ that is strictly increasing and discontinuous everywhere?

My line of thought (possibly incorrect): I know there are increasing functions such as $f(x) = x$, and there are everywhere-discontinuous functions such as the Dirichlet function. I also know that when there is a discontinuity at a point $c$, there is a finite gap $\epsilon$ such that there are points $d$ arbitrarily close to $c$ such that $|f(d) - f(c)| > \epsilon$. This is where my thinking gets unclear - does it make sense to have a "gap" at every real number?

-
No, for a monotone function the set of discontinuities is countable. – Jason DeVito Aug 11 '11 at 2:47
Since this is a standard homework problem, do not expect a full solution to be posted. – GEdgar Aug 11 '11 at 2:56
Conversely, every countable set is the set of discontinuities of some increasing function. – Jonas Meyer Aug 11 '11 at 3:03
@GEdgar, it appears that your premise (homework problem) is most probably correct and that your conclusion (no full solution posted) does not hold. I do not write this comment to approve such a functioning of MSE but to state an empirical observation. – Did Aug 11 '11 at 8:21
I admit in full honesty that I asked this question out of curiosity; it is not a homework problem for me as my calculus course did not go this far. – Nayuki Aug 11 '11 at 13:06

There is no such function. Suppose that $f:\mathbb{R}\to\mathbb{R}$ is strictly increasing. For each $a\in\mathbb{R}$ let $f^-(a) =$ $\lim\limits_{x\to a^-}f(x)$ and $f^+(a) = \lim\limits_{x\to a^+}f(x)$. Then $f$ is discontinuous at $a$ if and only if $f^-(a) < f^+(a)$. Let $D = \{a\in\mathbb{R}:f\text{ is not continuous at }a\}$, and for each $a\in D$ let $q_a$ be a rational number in the non-empty open interval $I_a = (f^-(a),f^+(a))$.

It’s not hard to check that if $a,b \in D$ with $a<b$, then $f^+(a) \le f^-(b)$, so the intervals $I_a$ are pairwise disjoint. This implies that the rational numbers $q_a$ are all distinct. (If you want to be fancy, the function from $D$ to $\mathbb{Q}$ that sends $a$ to $q_a$ is injective.) But there are only countably many rational numbers, so the set $D$ must be countable. In other words, the function $f$ can have at most countably many points of discontinuity. And of course $\mathbb{R}$ is uncountable, so $f$ cannot be discontinuous everywhere.

-
I should note for myself that $\lim_{x \rightarrow a^-} f(x)$ exists because of the least upper bound axiom for real numbers. – Nayuki Aug 11 '11 at 3:04
Why can you say that $I_a$ is a non-empty set? – Felipe Feb 8 '14 at 15:58
@Felipe Since $f$ is increasing, for all $x < y$, $f(x) < f(y)$. Suppose that $f$ is not continuous at $a$. Then the left hand limit is different than the right hand limit. But since $f$ is increasing, the left hand limit must be strictly less than the right hand limit: $f^{-}(a) < f^{+}(a)$. And since $I_a$ is defined to be the open interval between the limits, it must be non-empty because there is always a number between any two real numbers. – tmastny Dec 24 '14 at 19:02

Another way to see that it is impossible to have uncountably many of these "gaps" is to first consider the restriction of $f$ to a bounded interval $(a,b)$, where it is bounded. If $\varepsilon>0$, the number of points in $(a,b)$ where there is a gap of size greater than $\varepsilon$ is finite, less than $\frac{1}{\varepsilon}(f(b)-f(a))$. Taking countably many $\varepsilon$s going to zero allows you to conclude that there are only countably many discontinuities in $(a,b)$. Taking countably many $(a,b)$s whose union is $\mathbb R$ allows you to finish.

-
If you restrict $f$ to an open interval, you don't know it is bounded. Think of $\frac{1}{1-x}$ on $(0,1)$. If you restrict a continuous $f$ to a closed interval it is bounded. – Ross Millikan Aug 11 '11 at 5:26
@Ross: The restriction of a monotone function $f:\mathbb R\to\mathbb R$ to a bounded interval $(a,b)$ is bounded. Specifically, note that $f(a)\leq f(x)\leq f(b)$ for all $x$ in $(a,b)$. (One way to think of it: A monotone function on a closed bounded interval is always bounded, and $f$ is defined and monotone on $[a,b]$.) – Jonas Meyer Aug 11 '11 at 5:40
Yes, I see monotone is enough, too, on a closed interval, though you used notation for an open interval in the comment. – Ross Millikan Aug 13 '11 at 3:38
@Ross: I used notation for an open interval because I meant an open interval. The function is defined on the entire real number line. Therefore it is defined on each closed and bounded interval. It is bounded on such an interval. Therefore it is also bounded on the interior of the interval. I could have used closed intervals to begin with, but there is some convenience to considering open intervals due to the local character of continuity at a point. – Jonas Meyer Aug 13 '11 at 4:03
Generalizing this, if $f:(a,b)\to\mathbb R$ is monotone, then for each $c$ and $d$ with $a<c<d<b$, $f$ is bounded on $(c,d)$, with $f(c)\leq f(x)\leq f(d)$ for all $x\in(c,d)$. Note that in my answer, I was specific about how boundedness of $f$ on the bounded interval comes in where I mentioned the bound on the number of gaps of a given size. Your example is irrelevant because $\frac{1}{1-x}$ has no monotone extension to $\mathbb R$. – Jonas Meyer Aug 13 '11 at 4:08