Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Continuity $\Rightarrow$ Intermediate Value Property. Why is the opposite not true?

It seems to me like they are equal definitions in a way.

Can you give me a counter-example?


share|cite|improve this question

8 Answers 8

up vote 37 down vote accepted


Some of the answers reveal a confusion, so let me start with the definition. If $I$ is an interval, and $f:I\to\mathbb R$, we say that $f$ has the intermediate value property iff whenever $a<b$ are points of $I$, if $c$ is between $f(a)$ and $f(b)$, then there is a $d$ between $a$ and $b$ with $f(d)=c$.

If $I=[\alpha,\beta]$, this is significantly stronger than asking that $f$ take all values between $f(\alpha)$ and $f(\beta)$:

  • For example, this implies that if $J\subseteq I$ is an interval, then $f(J)$ is also an interval (perhaps unbounded).
  • It also implies that $f$ cannot have jump discontinuities: For instance, if $\lim_{x\to t^-}f(x)$ exists and is strictly smaller than $f(t)$, then for $x$ sufficiently close to $t$ and smaller than $t$, and for $u$ sufficiently close to $f(t)$ and smaller than $f(t)$, $f$ does not take the value $u$ in $(x,t)$, in spite of the fact that $f(x)<u<f(t)$. This indicates that if $f$ is discontinuous, its discontinuities must be somewhat wild.
  • In particular, if $f$ is discontinuous at a point $a$, then there are $y$ such that the equation $f(x)=y$ has infinitely many solutions near $a$.


There is a nice survey containing detailed proofs of several examples of functions that both are discontinuous and have the intermediate value property: I. Halperin, Discontinuous functions with the Darboux property, Can. Math. Bull., 2 (2), (May 1959), 111-118. It contains the amusing quote

Until the work of Darboux in 1875 some mathematicians believed that [the intermediate value] property actually implied continuity of $f(x)$.

This claim is repeated in other places. For example, here one reads

In the 19th century some mathematicians believed that [the intermediate value] property is equivalent to continuity.

This is very similar to what we find in A. Bruckner, Differentiation of real functions, AMS, 1994. In page 5 we read

This property was believed, by some 19th century mathematicians, to be equivalent to the property of continuity.

Though I have been unable to find a source expressing this belief, that this was indeed the case is supported by the following two quotes from Gaston Darboux's Mémoire sur les fonctions discontinues, Ann. Sci. Scuola Norm. Sup., 4, (1875), 161–248. First, on pp. 58-59 we read:

Au risque d'être trop long, j'ai tenu avant tout, sans y réussir peutêtre, à être rigoureux. Bien des points, qu'on regarderait à bon droit comme évidents ou que l'on accorderait dans les applications de la science aux fonctions usuelles, doivent être soumis à une critique rigoureuse dans l'exposé des propositions relatives aux fonctions les plus générales. Par exemple, on verra qu'il existe des fonctions continues qui ne sont ni croissantes ni décroissantes dans aucun intervalle, qu'il y a des fonctions discontinues qui ne peuvent varier d'une valeur à une autre sans passer par toutes les valeurs intermédiaires.

The proof that derivatives have the intermediate value property comes later, starting on page 109, where we read:

En partant de la remarque précédente, nous allons montrer qu'il existe des fonctions discontinues qui jouissent d'une propriété que l'on regarde quelquefois comme le caractère distinctif des fonctions continues, celle de ne pouvoir varier d'une valeur à une autre sans passer par toutes les valeurs intermediaires.


Additional natural assumptions on a function with the intermediate value property imply continuity. For example, injectivity or monotonicity.

Derivatives have the intermediate value property (see here), but there are discontinuous derivatives: Let $$f(x)=\left\{\begin{array}{cl}x^2\sin(1/x)&\mbox{ if }x\ne0,\\0&\mbox{ if }x=0.\end{array}\right.$$ (The example goes back to Darboux himself.) This function is differentiable, its derivative at $0$ is $0$, and $f'(x)=2x\sin(1/x)-\cos(1/x)$ if $x\ne0$, so $f'$ is discontinuous at $0$.

This example allows us to find functions with the intermediate value property that are not derivatives: Consider first $$g(x)=\left\{\begin{array}{cl}\cos(1/x)&\mbox{ if }x\ne0,\\ 0&\mbox{ if }x=0.\end{array}\right.$$ This function (clearly) has the intermediate value property and indeed it is a derivative, because, with the $f$ from the previous paragraph, if $$h(x)=\left\{\begin{array}{cl}2x\sin(1/x)&\mbox{ if }x\ne 0,\\ 0&\mbox{ if }x=0,\end{array}\right.$$ then $h$ is continuous, and $g(x)=h(x)-f'(x)$ for all $x$. But continuous functions are derivatives, so $g$ is also a derivative. Now take $$j(x)=\left\{\begin{array}{cl}\cos(1/x)&\mbox{ if }x\ne0,\\ 1&\mbox{ if }x=0.\end{array}\right.$$ This function still has the intermediate value property, but $j$ is not a derivative. Otherwise, $j-g$ would also be a derivative, but $j-g$ does not have the intermediate value property (it has a jump discontinuity at $0$). For an extension of this theme, see here.

In fact, a function with the intermediate value property can be extremely chaotic. Katznelson and Stromberg (Everywhere differentiable, nowhere monotone, functions, The American Mathematical Monthly, 81, (1974), 349-353) give an example of a differentiable function $f:\mathbb R\to\mathbb R$ whose derivative satisfies that each of the three sets $\{x\mid f'(x)>0\}$, $\{x\mid f'(x)=0\}$, and $\{x\mid f'(x)<0\}$ is dense (they can even ensure that $\{x\mid f'(x)=0\}=\mathbb Q$); this implies that $f'$ is highly discontinuous. Even though their function satisfies $|f'(x)|\le 1$ for all $x$, $f'$ is not (Riemann) integrable over any interval.

On the other hand, derivatives must be continuous somewhere (in fact, on a dense set), see this answer.

Conway's base 13 function is even more dramatic: It has the property that $f(I)=\mathbb R$ for all intervals $I$. This implies that this function is discontinuous everywhere. Other examples are discussed in this answer.

Halperin's paper mentioned above includes examples with even stronger discontinuity properties. For instance, there is a function $f:\mathbb R\to\mathbb R$ that not only maps each interval onto $\mathbb R$ but, in fact, takes each value $|\mathbb R|$-many times on each uncountable closed set. To build this example, one needs a bit of set theory: Use transfinite recursion, starting with enumerations $(r_\alpha\mid\alpha<\mathfrak c)$ of $\mathbb R$ and $(P_\alpha\mid\alpha<\mathfrak c)$ of its perfect subsets, ensuring that each perfect set is listed $\mathfrak c$ many times. Now recursively select at stage $\alpha<\mathfrak c$, the first real according to the enumeration that belongs to $P_\alpha$ and has not been selected yet. After doing this, continuum many reals have been chosen from each perfect set $P$. List them in a double array, as $(s_{P,\alpha,\beta}\mid\alpha,\beta<\mathfrak c)$, and set $f(s_{P,\alpha,\beta})=r_\alpha$ (letting $f(x)$ be arbitrary for those $x$ not of the form $s_{P,\alpha,\beta}$).

To search for references: The intermediate value property is sometimes called the Darboux property or, even, one says that a function with this property is Darboux continuous.

An excellent book discussing these matters is A.C.M. van Rooij, and W.H. Schikhof, A second course on real functions, Cambridge University Press, 1982.

share|cite|improve this answer
Very nice answer. –  Beni Bogosel Dec 30 '13 at 18:02
Thank you.${}{}$ –  Andrés Caicedo Dec 30 '13 at 18:43
you mean $u$ smaller than $f(t)$ in point 2? –  Neeraj Bhauryal Jan 1 '14 at 14:40
@NeerajBhauryal Indeed. Thanks. –  Andrés Caicedo Jan 1 '14 at 16:48

Let $f(x) = x^2\sin(1/x)$ on $(0,1)$ and $f(0) = 0$. Then $f$ is differentiable throughout $[0,1]$. All derivatives satisfy the intermediate value property (Darboux's Theorem); but $f'(x)$ is discontinuous at $0$.

share|cite|improve this answer
I like your answer better! –  user44197 Dec 30 '13 at 8:22
@user44197 you are very gracious -- your answer is a good one and very straightforward. –  Betty Mock Dec 31 '13 at 21:24

$$ f(x) = \sin(1/x), ~~ x \gt 0$$ and $$f(0) =0$$

This is not continuous at $x=0$ but clearly satisfies the intermediate value property.

share|cite|improve this answer
Maybe you should have added some details on the part "clearly satisfies the intermediate property" to convince the OP that this example is simpler than the derivative one. –  Beni Bogosel Dec 30 '13 at 8:48
(@BeniBogosel This function is a derivative, so it is in essence the same example -- without being explicit about it having an antiderivative.) –  Andrés Caicedo Dec 30 '13 at 17:44
@AndresCaicedo: Yes, of course, but it is possible to prove that this function has the Darboux property without passing through the theorem about the derivative; using only the definition. –  Beni Bogosel Dec 30 '13 at 18:02
@BeniBogosel Oh, definitely. –  Andrés Caicedo Dec 30 '13 at 18:04

The next theorem might be of interest to you, it really shows that the class of functions with the IVP is very big.

Theorem (Sierpinski) Let $f : \mathbb R \to \mathbb R$ be any function. Then there exists $f_1,f_2 : \mathbb R \to \mathbb R$ such that $f=f_1+f_2$ and $f_1,f_2$ satisfy the Intermediate Value Property.

Moreover, in the above Theorem, $f_1,f_2$ can be chosen to be discontinuous at all points.

share|cite|improve this answer
Two further results in the same direction: 1. Any function $f:\mathbb R\to\mathbb R$ is the pointwise limit of a sequence of functions that satisfy the intermediate value property. 2. For any function $f:\mathbb R\to\mathbb R$ there is a function $g$ that has the intermediate value property and such that $\{x\mid f(x)\ne g(x)\}$ is both meager and of measure zero. –  Andrés Caicedo Jan 1 '14 at 17:14

To begin I want to state the IVP considering I messed up on the definition:

Let $I$ be an open interval and $f : I \to \mathbb{R}$ then $f$ has the IVP iff Given $a,b \in I : a \le b$ $$ \forall \; y \text{ between } f(a),f(b) \; \exists \; x \in [a,b] : f(x) = y $$

The following function has IVP on $\mathbb{R}$ but it is not continuous on all of $\mathbb{R}$ EDIT: this a discontinuous surjective function ;) $$ f: \mathbb{R} \to \mathbb{R} ,\; f(x) = \left\{ \begin{array}{c} \frac{1}{x} : x \neq 0 \\ 0 : x = 0 \end{array}\right. $$ Like everyone else has said this guy named Darboux (pretty cool guy) came up with the following theorem:

Given an open interval $I$ and $f$ a differentiable function (NOTE: $f$ doesn't necessarily have to be $C^1$!) s.t. $f : I \to \mathbb{R}$, $\frac{\mathrm{d} f}{\mathrm{d} x} = f'$ has IVP on $I$.

So a pretty common example is putting $$ f : (-1,1) \to \mathbb{R}, \; f(x) = \left\{ \begin{array}{rl} x^2 \sin \left( \frac{1}{x} \right) : & x \neq 0 \\ 0 : & x = 0 \end{array} \right. $$ and then seeing that $f'(x) = 2x \sin \left( \frac{1}{x} \right) - \cos \left( \frac{1}{x} \right) : x \neq 0$ (chain rule, in case you brain fart often like I do) and thus $f'$ is clearly discontinuous at $x=0$ but by Darboux's Theorem it has IVP!

share|cite|improve this answer
As with Michael's example, this function does not have the intermediate value property (or the definition you are using is not the standard one). –  Andrés Caicedo Dec 30 '13 at 8:32
@AndresCaicedo ah yes you're right, forgot that the $x$ you find has to lie in the interval $[a,b]$... I will change this sorry for that –  DanZimm Dec 30 '13 at 8:40
I'm thinking about my $f$ I'm not entirely convinced it's differentiable - forgive me I think I have brain farted again -_- : Now I am ;P –  DanZimm Dec 30 '13 at 9:01

A very strong counterexample would be a function whose range is all of R on every interval.

share|cite|improve this answer
One can do even more: There are functions $f$ that take every value continuum many times on every perfect set. –  Andrés Caicedo Dec 30 '13 at 21:45
That sounds like partitioning reals into continuum many Bernstein sets. –  hot_queen Dec 31 '13 at 0:30
Yes. Though one can build examples by transfinite induction, without making the connection explicit. A nice survey on some of these results is Discontinuous functions with the Darboux property, by I. Halperin, Can. Math. Bull. vol. 2, no. 2, May 1959, 111-118. It contains the amusing quote "Until the work of Darboux in 1875 some mathematicians believed that [the intermediate value] property actually implied continuity of $f(x)$." Would you happen to know of a source showing that this was indeed the case? –  Andrés Caicedo Dec 31 '13 at 0:51
I don't know. Halperin doesn't seem to give a reference. Although I don't think Bolzano would have had this confusion. I also noticed Lebesgue's very elegant counterexample there. –  hot_queen Dec 31 '13 at 2:41
Yes, it is quite puzzling. I'm calling it an urban legend until someone convinces me otherwise. –  Andrés Caicedo Dec 31 '13 at 2:50

Here is a simple example which satisfies the IVP on every closed bounded interval, yet is continuous at only a single point. Consider the function f defined on the reals such that f(x)=0 if x is rational and f(x)=x if x is irrational. The function f has the IVP property on every interval, yet is only continuous at x=0.

share|cite|improve this answer
This function is not a Darboux function. (It does not attain non-zero rational values.) –  Martin Sleziak Dec 30 '13 at 15:19
You're right. My mistake. Sorry –  Matt Brenneman Dec 30 '13 at 21:06

Finding a counter example is very simple. Take any function $f(x)$ which is continuous in the interval $[a,b]$. Now take any two real numbers $c$ and $d$ with $a \lt c \lt d \lt b$ and $f(c) \neq f(d)$ and define a new function as: $$g(x) = \begin{cases} f(x) & a \leq x \lt c\\f(d) & x=c\\f(x) & c \lt x \lt d\\f(c) & x=d\\f(x) & d \lt x \leq b\end{cases}$$ It is easy to check that IVP holds in the case of $g(x)$ but it is discontinuous at $x=c$ and $x=d$.

share|cite|improve this answer
This function does not have the intermediate value property. –  Andrés Caicedo Dec 30 '13 at 17:00
@AndresCaicedo, I do not get why it does not have the intermediate value property...all I've done is rubbed two points in the graph and exchanged their function values and the rest remains the same.?? –  Indrayudh Roy Dec 31 '13 at 16:44
The intermediate value property requires that whenever $I$ is an interval subset of $[a,b]$, $f(I)$ is also an interval. This fails with your function (it is not enough that $f([a,b])$ is an interval). In fact, functions with the intermediate value property cannot have jump discontinuities. –  Andrés Caicedo Dec 31 '13 at 16:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.