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

I have a function that is defined as such,

$f(x)=x$, if x is rational, ie $x=\frac{p}{q}$ and $f(x)=1-x$, if x is irrational. What are all the points of continuity?

I would say that all the points of continuity are the points where $p\neq q$ since at any the limit of f(x) as x approaches 1 is 0, while the functional value of the limit of x, as x approaches 1 is 1. Since they do not agree, the function is discontinuous at any point $p=q$

Is that view correct?

share|cite|improve this question
When $p=q$, $x=1$. The representation of a rational as quotient of integers is immaterial to this problem. – Lubin Nov 27 '12 at 23:47
up vote 3 down vote accepted

Note that every point is the limit of a rational sequence and an irrational sequence.

So $f$ is continuous at $x_0$ if and only if approximating by rational and irrational sequences give the same result.

So we have $r_n\to x_0$ which are all rationals and $y_n\to x_0$ which are all irrational, and we want: $$x_0=\lim_{n\to\infty} r_n = \lim_{n\to\infty} f(r_n) = f(x) = \lim_{n\to\infty} f(y_n) = \lim_{n\to y_n} (1-y_n)= 1 - \lim_{n\to y_n} y_n=1-x_0$$

Therefore we see that $f$ can be continuous at $x_0$ if and only if $x_0=1-x_0$, and so $x_0=\frac12$.

share|cite|improve this answer

The only points where $f$ might be continuous is $x=1/2$. You can simply verify this straight forward by using your definition of continuity.

At all other point $f$ can't be continuous. Remember, that irrational and rational numbers both are dense in $\mathbb{R}$.

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.