Examples where $g$ is a strictly increasing function on an interval say $J$ but $g$ is not continuous.

examples-counterexamplesreal-analysis

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.

Best Answer

$f(x)=x$ for $x<0$ and $f(x)=x+1$ for $\geq 0$ is such a function.