Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say $f$ is continuous on $(a,b)$. Is it true that it can always be extended to a continuous function on $[a,b]$? What if it's a uniformly continuous function; can it be extended to a uniformly continuous function on $[a,b]$?

I'm thinking that, if it's continuous on $(a,b)$, then $\lim_{x\to a^+} f(x)$ and $\lim_{x\to b^-} f(x)$ exist, and then one can just define $f(a)$ to be $\lim_{x\to a^+} f(x)$, and similarly for $f(b)$. I'm not too sure about that, though.

And if that's the case, then the other one (uniform continuity) follows easily, since $[a,b]$ is compact.

share|cite|improve this question
No, not in general, consider $f(x)=1/x$ on $(0,1)$; or any continuous function unbounded at the end points. For a uniformly continuous function, you can extend, though, and your argument carefully carried out will work. – David Mitra May 5 '12 at 16:06
It is true for uniformly continuous functions, see this question: Continuous extension of a uniformly continuous function from a dense subset and this one: functions defined on metric spaces. – Martin Sleziak May 5 '12 at 16:08
See here also. – David Mitra May 5 '12 at 16:10
Also think about $f(x) = \sin(1/x)$ on $(0,1)$ to see that boundedness is not the issue. – Nate Eldredge May 5 '12 at 17:43
up vote 4 down vote accepted

The function $$ f(x)=\frac1{x(x-1)} $$ is continuous on $(0,1)$ but does not extend to a continuous function on $[0,1]$.

share|cite|improve this answer
This answers only a part of the question. – Lierre May 5 '12 at 16:16
@Lierre: I know. – Andrea Mori May 5 '12 at 16:18
It, and the other comments above, were enough. – FPP May 5 '12 at 16:50

A discussion of extending continuous functions $f: S \subset \mathbb{R}$ to $\overline{S}$ is given in $\S 10.11$ of these notes.

Unfortunately this discussion doesn't contain any examples or applications. Here is one thing that should probably be in there, and which will lead you to see that not every continuous function on $(a,b)$ is uniformly continuous:

Proposition: A uniformly continuous function $f$ defined on a bounded subset $S$ of $\mathbb{R}$ is bounded.

Proof: There is $\delta > 0$ such that for all $x,y \in S$ with $|x-y| \leq \delta$, $|f(x)-f(y)| \leq 1$. Suppose $\sup(S) - \inf(S) = d$ -- this $d$ is called the diameter of $S$ -- and choose a positive integer $N \geq \lceil \frac{d}{\delta} \rceil$. Then we can cover $S$ by $N$ subintervals of length $\delta$, and by the triangle inequality, for all $x,y \in S$, $|f(x)-f(y)| \leq N$. Taking any $x_0 \in S$, we get an upper bound of $|f(x_0)| + \lceil \frac{d}{\delta} \rceil$ for $f$ on $S$.

The above argument is decidedly quantitative, and in fact the bound it gives is sharp, as one sees by considering $f(x) = \frac{1}{\delta}x$ on the interval $[0,d]$ and taking $x_0 = 0$. On the other hand, one can show (more easily!) that if $X$ is any totally bounded metric space and $f: X \rightarrow \mathbb{R}$ is uniformly continuous, then $f$ is bounded. (Note though that the above quantitative argument won't go through in this level of generality: we used some geometric properties of $\mathbb{R}$ related to its "covering dimension". However, it can be pushed through in $\mathbb{R}^N$ with a different bound, depending on $N$.)

And in fact one can show this again as follows: every uniformly continuous function $f$ defined on any metric space extends uniquely to its completion $\tilde{X}$. Further, $X$ is totally bounded iff $\tilde{X}$ is compact, and a continuous function on a compact space is bounded.

All of this should serve to motivate Andrea Mori's example of a continuous function $f: (0,1) \rightarrow \mathbb{R}$ which cannot be continuously extended to $[0,1]$.

share|cite|improve this answer

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.