Take the 2-minute tour ×
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.

If $f: \mathbb{R} \to \mathbb{R}$ is continuous at $a$, is it continuous in some open interval around $a$?

share|improve this question
Not a duplicate, but the answer is a consequence of this answer. –  Git Gud Jun 2 '13 at 20:47
There you go! $5$ answers in less than a minute! –  Pedro Tamaroff Jun 2 '13 at 20:47

6 Answers 6

No, that's not true. Take the function $f : \mathbb R \to \mathbb R$ defined by $f(x) = 0$ if $x \in \mathbb Q$ and $f(x) = x$ if $x \not\in \mathbb Q$. Then $f$ is discontinuous everywhere except at $0$ (can you prove this?).

share|improve this answer
This is fascinating and basically stretches the concept of continuity, or at least illustrates a facet of it. The question suggests itself, if $f$ is continuous only at zero, to where does it continue? ;) –  Kaz Jun 3 '13 at 4:56
This works whenever $x$ and $0$ are replaced by two functions that converge to the same value at certain points, right? For instance, with $x^2$ and $x$ the associated function would be continuous only at $0$ and $1$? –  Jack M Jun 3 '13 at 12:59
@JackM: Yes, it works. –  Najib Idrissi Jun 3 '13 at 13:57

No. Take $$x\mapsto \left\lfloor\frac 1 x\right\rfloor^{-1}$$

It is continuous at $x=0$; but has discontinuities on every $x_n=\dfrac 1 n$

ADD On a side note, it is not hard to show this function is continuous at $0$. Use the squeeze theorem with $x$ and $2x$ for $x\to 0^+$ and $x$ and $x/2$ for $x\to 0^{-}$. Of course, we need to set $0\mapsto 0$.

share|improve this answer

No. Consider the function $$f(x)=\begin{cases} x &\text{if } x\in \mathbb Q\\ -x &\text{otherwise} \end{cases}$$ which is continuous at $0$, but not at any other real number.

share|improve this answer

Not necessarily:

$$f(x)=\begin{cases} x,&\text{if }x\in\Bbb Q\\ -x&\text{if }x\in\Bbb R\setminus\Bbb Q \end{cases}$$

is continuous only at $0$.

share|improve this answer

Here is a function that is continuous at every irrational point, and discontinuous at every rational one. So the answer is no.

share|improve this answer

Fix an enumeration of the rationals, $q_n$ for $n\in\Bbb N$. We define the following function:$$\large f(x)=\sum_{q_n<x}\frac1{2^n}$$

That is, we sum $\frac1{2^n}$ for all the $n$ such that $q_n$ is strictly smaller than $x$. This function is continuous at every irrational number, but discontinuous at every rational number. Therefore it cannot be continuous on any interval.

share|improve this answer
For more fun, see the addendum here. –  Pedro Tamaroff Jun 2 '13 at 23:35

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.