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.

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

consider the simple function $$f(x) = \left\{ \begin{array}{ll} 1 & \mbox{if $x \in [0,1]$}\\ 10 & \mbox{if $x \in \mathbb{Q} \cap [1,2]$}\\ -10 & \mbox{if $x \in \mathbb{Q^c} \cap [1,2]$}\\ 2 & \mbox{if $x \in [2,3]$}\ \end{array} \right.$$

is it correct to say that f is continuous on $[0,1] \cup [2,3]$?

share|cite|improve this question
up vote 1 down vote accepted

As others have pointed out, it seems reasonable to assume that you meant to define $f$ like this: $$f = \chi_{[0,1]} + 10\chi_{\mathbb{Q}\cap (1,2)} -10\chi_{(1,2)\setminus\mathbb{Q}} +2\chi_{[2,3]}, $$ where $\chi_A$ is the indicator function on $A$.

And it is true that $f|_{[0,1]\cup [2,3]}$ is continuous since it's constant on each of its domain's connected components.

share|cite|improve this answer
I think you mean $\mathbb{Q}\cap(1,2)$ in the second term – Ross Millikan Feb 27 '11 at 4:59
@Ross: Thanks for letting me know about that typo. That's part of the reason why my usual preamble contains definitions of the commands \union and \intersect. It's much harder to accidentally mess those up – kahen Feb 27 '11 at 5:21

Hint: Your function is not well defined at 1 and 2, as those $x$ values each meet two of your criteria. Having fixed that, say by making the interval in the second line $(1,2)$, what happens near 1 and 2?

share|cite|improve this answer

This function is not well-defined at some points. For example $f(1) = 1$ since $1 \in [0,1]$, but also $f(1) = 10$ because $1 \in \mathbb{Q} \cap [1,2]$ as well (similarly for $x=2$).

Once you correct this, note that if you define $f(1)=1$, then arbitrarily close to $1$ you can find numbers that are rational (or irrational) and greater than one. Here the function evaluates to $10$ (or $-10$), and so it will not be continuous at $1$ (nor at $2$ for the same reason).

share|cite|improve this answer

(Assume the definition of the function is corrected so that $f(1)=1$, $f(2)=2$.)

$f$ is a function on $[1,3]$. The points where $f$ is continuous are $[0,1) \cup (2,3]$. In that sense, one would not say that $f$ is continuous on $[0,1] \cup [2,3]$.

However, what is true is that the restriction $f|_{[0,1] \cup [2,3]}$ of $f$ to $[0,1] \cup [2,3]$ is a continuous function on all of its domain. But strictly speaking this is a different function from $f$.

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.