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

The classical example of a functions with only one point of continuity is $$ f(x) = \begin{cases} x & \text{if } x \in \mathbf{Q}, \\ 0 & \text{otherwise}. \end{cases} $$

I only want to prove the continuity at $0$, using the definition in terms of open sets. Let $(a,b)$ be an open set containing $0$. I want to prove that the preimage of this interval is open in $\mathbf R$. But since every preimage contains the $0$ element, the preimage consists of all irrational numbers and the rational numbers of the interval $(a,b)$, but this set is not open. What am I doing wrong?

share|cite|improve this question
I fixed up your TeX, I think. The cases environment is good for this sort of thing. Also, you don't need to use \left and \right on something like $f(x)$ here. – Dylan Moreland Aug 29 '11 at 23:35
To appeal to metric properties where only topological ones are involved might be seen as using the dark side of the Force but, to prove the precise statement you propose, I would simply write that $|f(x)|\le|x|$ for every $x$. – Did Aug 30 '11 at 14:20
up vote 16 down vote accepted

$f$ is continuous at $x$ if the preimage of every open neighborhood of $f(x)$ contains an open neighborhood of $x$. The preimage need not be open itself.

For a simpler example, let $g(x)=1$ if $x\geq 0$, and let $g(x)=0$ when $x<0$. Then $g$ is continuous at $x=1$, but the preimage of $(0,2)$ is $[0,\infty)$, which is not open in $\mathbb R$. Nonetheless, the preimage contains the open neigborhood $(0,2)$ of $x=1$.

Translating this to $\varepsilon$s and $\delta$s, recall that $f$ is continuous at $x$ if for all $\varepsilon>0$ there exists $\delta>0$ such that $\{y:|x-y|<\delta\}\subseteq f^{-1}(\{y:|f(x)-y|<\varepsilon\})$. Here $\{y:|x-y|<\delta\}$ is the neighborhood of $x$, and it is only required to be contained in the preimage of the neighborhood $\{y:|f(x)-y|<\varepsilon\}$ of $f(x)$.

share|cite|improve this answer

Hint: What is the definition of continuity at a point in terms of open sets? How does it differ from the global definition of continuity in terms of open sets?

share|cite|improve this answer
Oh thanks man :D!!! – Daniel Aug 30 '11 at 1:46

If a function is continuous everywhere then the pre-image of every open set under that function is open.

But in this problem it is not the case that the function is continuous everywhere, so one should not expect the pre-image of every open set to be open.

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.