TITLE: examples where $g$ is a strictly increasing function on an interval say $J$ but $g$ is not continuous.
QUESTION [0 upvotes]: I am reading Elementary Analysis The theory of Calculus by Kenneth A Ross.
Theorem 18.5 Page 130 says 
Let $g$ be a strictly increasing function on an interval $J$ such that $g(J)$ is an interval $I$. Then $g$ is continuous on $J$.
I want to construct some examples where $g$ is a strictly increasing function on an interval say $J$ but $g$ is not continuous.  I am trying to see and appreciate why "$g(J)$ is an interval"  is necessary here.
I have constructed some examples by drawing graphs but I want to know some concrete examples. 
Thanks.

REPLY [1 votes]: Let $k$ be a bijection from $\Bbb Q \cap [0,1]$ to $\Bbb N$. Let $g$ be defined on $[0,1]$ by
$$g(x)=\sum_{q\le x} 2^{-k(q)}$$
Where the sum runs on rational $q$ in $[0,x)$.
This function is strictly increasing, continuous at irrational $x$ and discontinuous at rational $x$.
{"set_name": "stack_exchange", "score": 0, "question_id": 3214418}