For the following set, construct $f:\mathbb{R} \to \mathbb{R}$ such that it is discontinuous at every point in the set and continuous on the complement.

This is the set I am given:

Let $X$= $(0,1)$.

Here is my proposed answer, but I am not sure how to prove it works.

Suppose $f(x) = \begin{cases} 0&\text{if $x\leq 0$}\\ 1 &\text{if $x \in (0,1)$ and rational,} \\ 2 &\text{if $x \in (0,1)$ and irrational, and} \\ 0 &\text{if $x\geq 1$} \\ \end{cases}$

Does this work?


Your function won't be continuous at $0$ and $1$. (For $0$, the right-hand limit does not exist and for $1$, the left-hand limit does not exist.) You can rectify this by defining $$ \begin{aligned} f(x):= \begin{cases} \ \ \ \ \ 0 &\text{ if } \ \ x\notin X\cap\mathbb{Q}\\ x^{2}-x &\text{ if } \ \ x\in X\cap \mathbb{Q} \end{cases}. \end{aligned} $$

This function will still be discontinuous on all of $X$. But, it will now be continuous on all of $X^{c}$, including $0$ and $1$. You should check the details here, but it's basically because $0$ and $1$ are zeros of $x^{2}-x$.

  • $\begingroup$ Why would the function not be continuous at $0$ and $1$? Wouldn't the function equal $0$ at those points? $\endgroup$
    – Pam_22R
    Nov 12 '17 at 21:34
  • $\begingroup$ For your function to be continuous at $0$ say you would need $\lim_{x\to 0} f(x)=0$. But the right-hand limit $\lim_{x\to 0^{+}}f(x)$ does not exist, since as $x$ approaches $0$ from the right, your function oscillates between $1$ and $2$. $\endgroup$
    – ervx
    Nov 12 '17 at 21:39
  • $\begingroup$ No. You would need both the rational and irrational points converging to the same value. If you are using two distinct horizontal lines, this cannot happen. And, if the horizontal lines are not distinct, then the function would be continuous on $X$. $\endgroup$
    – ervx
    Nov 12 '17 at 21:48
  • $\begingroup$ I am not sure I follow your reasoning. I got why the fact that the right and left limits do not exist for either 0 or 1 respectively contradictions the function being continuous at these points. I do not understand how having jumps between 1 and 2 would not give us discontinuity in the interval. $\endgroup$
    – Pam_22R
    Nov 12 '17 at 22:00
  • $\begingroup$ It would. That's not what I meant. Maybe I misunderstood what you said. The function you constructed is discontinuous at all points in $X$. It just happens that it's also discontinuous at $0$ and $1$. $\endgroup$
    – ervx
    Nov 12 '17 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.