22

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

Najib Idrissi
  • 56,269
user80704
  • 221
  • 1
  • 3

6 Answers6

25

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?).

Kaz
  • 7,007
Najib Idrissi
  • 56,269
  • 5
    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 03 '13 at 04: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 03 '13 at 12:59
  • @JackM: Yes, it works. – Najib Idrissi Jun 03 '13 at 13:57
  • @Kaz what do you mean ? – nicolas Nov 13 '14 at 14:15
15

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$.

Pedro
  • 125,149
  • 19
  • 236
  • 403
13

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.

Alex Becker
  • 61,883
12

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$.

Brian M. Scott
  • 631,399
10

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

vadim123
  • 83,937
6

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.

Asaf Karagila
  • 405,794