# Continuity at a point implies continuity on an interval?

If $f(x)$ is continuous at $a$, then is there a $\sigma$ such that $f(x)$ is also continuous on $(a-\sigma, a+\sigma)$? This looks very intuitive, but I don't know how to prove it.

-

No, for example take $$f(x) = \begin{cases} x &\text{ if } x\in\mathbb{Q} \\ -x &\text{ if } x\in\mathbb{R}-\mathbb{Q} \end{cases}$$

then $f$ is continous in $x=0$, but not continous on $\left(-\varepsilon,\varepsilon\right)$ ($\forall\varepsilon\gt0$)

If you chose $f:\left[0,1\right]\rightarrow\mathbb{R}$ with

$$f(x) = \begin{cases} 1 &\text{ if } x=0 \\ 0 &\text{ if } x\in\mathbb{R}-\mathbb{Q} \\ q^{-1} & \text{ if } x=pq^{-1} \text{ with } p,q\in\mathbb{N} \text{ and } gcd(p,q)=1 \end{cases}$$

then $f$ becomes even continous in every irrational point, but you cannot find any intervall $\left(a,b\right)$ with $a\neq b$ where $f$ is continous.

-
I have selected this answer because it's the most detailed, and the second example is wonderful. Thanks! BTW, how do you format those set symbols like $Q$ and $R$? – qed Dec 4 '12 at 23:29
@CravingSpirit: e.g: \mathbb{Q} $\rightarrow \mathbb{Q}$ – user127.0.0.1 Dec 4 '12 at 23:34

This is not true. A standard example is $$f(x)=\begin{cases} x\text{ if }x\in\mathbb{Q}\\ 0\text{ if }x\not\in\mathbb{Q} \end{cases}$$ The function $f(x)$ is continuous at $x=0$, but not continuous on any open interval.

-

It’s false: the function

$$f(x)=\begin{cases}x,&\text{if }x\text{ is rational}\\-x,&\text{if }x\text{ is irrational}\end{cases}$$

is continuous only at $x=0$.

-

It is a theorem that the discontinuity set of a real valued function is a $F_{\sigma}$ set, which means that it can be expressed as a countable union of closed sets. Conversely, the set of continuous points is $G_{\delta}$, which means it is a countable intersection of open sets. In general, a $G_{\delta}$ set need not contain an interval, so the answer to your question is no. What is true, however, is that it will always almost contain an interval, in a precise sense.

See here.

-
Thanks for the reference! – qed Dec 4 '12 at 23:32