Give an example of a monotonic increasing function which does not satisfy intermediate value property. Give an example of a monotonic increasing function which does not satisfy intermediate value property.

I have no idea whether that function would be continuous or discontinuous. Please give me the example(s) with proper reason. Thank you very much. 

 A: Well, the intermediate value theorem says that any continuous $f:I \to \mathbb{R}$, where $I \subset \mathbb{R}$ is an interval (and we allow notations like $(-\infty,\infty)=\mathbb{R}$) has the intermediate value property. So in order to find a function which fails to have the intermediate value property, it had better either be 


*

*discontinuous, or

*defined on a set which is not an interval in $\mathbb{R}$ 


It turns out you can get a counterexample with either strategy. The idea of the intermediate value property is that the function can't "jump" from one value to the next: it has to take every value in between.  
In fact, we'll use essentially the same function for both properties. Consider the function $f: \mathbb{R} \to \mathbb{R}$ defined by
$$f(x)=\cases{0 \quad \text{ if }x<0\\1\quad \text{ if }x>0}$$
and $f(0)=0$. Then $f$ is continuous everywhere except $0$, but it does not have the intermediate value property: $f$ takes the value $0$ (at $-1$), and it takes the value $1$ (at $1$), but there is no point $x$ such that $-1<x< 1$ and $f(x)=\frac{1}{2}$, say.  
If, instead of taking $f$ as a function $\mathbb{R} \to \mathbb{R}$, we choose to look at it as a function $\mathbb{R} \setminus \{0\} \to \mathbb{R}$ (and do not define it at $x=0$), then it is continuous at every point at which it is defined, but fails to have the intermediate value property for the same reason. So both hypotheses of the theorem are necessary! 
EDIT: There may be a slight confusion over whether this function is monotone increasing - this function is (according to the definition I'm used to) increasing, but not strictly increasing. It is pretty straightforward to use it to generate an example of a strictly increasing function, though.
