$I$ is an interval, $I^0$ is the interior of $I$. Let $f:I\to\Bbb R$ be a function with intermediate value property on $I$, and $f$ is monotonic on $I^0$. Does it follow that $f$ is continuous on $I$?
[Math] Intermediate value and monotonic implies continuous
analysiscontinuityreal-analysis
Related Solutions
[I thought of another proof that uses the IVP and injectiveness once. Putting it as a community wiki answer.]
Assume on the contrary that $f$ is not continuous at $x$. Then there is a sequence $x_n$ converging to $x$ such that $f(x_n)$ does not converge to $f(x)$. Then there is $\epsilon>0$ and a subsequence $x_{n_k}$ such that $f(x_{n_k}) \notin (f(x)-\epsilon,f(x)+\epsilon)$.
There must either be a further subsequence $x_{n_j}$ such that $f(x_{n_j}) \leq f(x)-\epsilon$ or a subsequence $x_{n_q}$ such that $f(x_{n_q}) \geq f(x)+\epsilon$ (or both). Assume without loss of generality the former.
Since $f(x_{n_j}) \leq f(x)-\epsilon < f(x)$, by the IVP for every $j$ there is a $y_j$ such that $x_{n_j}\leq y_j < x$ and $f(y_j)=f(x)-\epsilon$.
Because $f$ is injective, all the $y_j$ must be the same, say $y$. Because $x_{n_j}$ converges to $x$, $y=x$ by the sandwich theorem. But $f(y)\neq f(x)$. Hence a contradiction.
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.
Best Answer
Hint: Let $x \in I$. Assume $f$ is increasing, since the decreasing case is similar.
We want to show that $\lim_{h\rightarrow 0} f(x+h) = f(x)$. By the intermediate value property, $\forall \epsilon > 0 \exists h_0, h_1 $ such that $f(x+h_0) - f(x) = \epsilon$ and $f(x)-f(x-h_1) = \epsilon$ (note that possibly only one of the $h_i$ exist if $x$ is an end point of I). Can you think what to do next?