Continuity of an increasing function on a dense set Let $f$ be increasing on $D$ ($D$ is dense in $\mathbb{R}$), and define $\tilde{f}$ on $(-\infty,\infty)$ as follows: $$ \forall x: \tilde{f}(x) = \inf_{x<t\in D} f(t).$$
Show that continuity of $f$ on $D$ does not imply that of $\tilde{f}$ on $(-\infty,\infty),$ but uniform continuity does imply uniform continuity.
This is an exercise problem in chapter 1 of "A Course in Probability Theory" (Chung). I think that the second part is saying that $f$ is uniformly continuous on the set $D.$
I can't figure out how to prove this problem.
Thank you.
 A: Suppose that $D = \mathbb R \setminus \{0\}$ and that $f : D \to \mathbb R$ is given by $$f(x) = \left\{ \begin{array}{cl} x & \text{ if }x < 0, \\ x+1 & \text{ if }x > 0. \end{array} \right.$$
Then $f$ is continuous on $D$, but
 $$\tilde f(x) = \left\{ \begin{array}{cl} x & \text{ if }x < 0, \\ x+1 & \text{ if }x \ge 0 \end{array} \right.$$ is not continuous on $\mathbb R$.
The situation is entirely different if $f$ is uniformly continuous. Fix $\epsilon > 0$ and select $\delta > 0$ so that $x,y \in D$ and $|x-y| < \delta$ imply $|f(x) - f(y)| < \epsilon$.
Suppose that $x,y \in \mathbb R$ and $|x-y| < \delta$. Assume without loss of generality that $x < y$. Next select points $a,b \in D$ with $a < x <  y < b$ and $b - a < \delta$. This is possible since $D$ is dense. Since $f$ is nondecreasing you have
$$
0 \le \tilde f(y) - \tilde f(x) \le f(b) - f(a) < \epsilon$$
giving you uniform continuity of $\tilde{f}$.
A: Let $q_n$ be an enumeration of the rationals (since they're countable) and define $g(q_n) = 1/2^n$, and define $f(x) = \sum_{q_n \leq x} g(q_n)$. Then this should give you your increasing function which is continuous on a dense subset but not continuous anywhere else when you extend to ${\mathbb R}$. In a certain sense this shows how "bad" things can be when you only consider continuity.
