# Real Analysis: Continuity and discontinuity

1. Nov 21, 2013

1) For the following choice of A, construct a function f: R → R that has discontinuities at every point x in A and is continuous on the complement of A.

A = { x : 0 < x < 1} My function is f(x) = 10 if x in (0,1) and Q and f(x) = 20, if x in (0,1) and irrational number, f(x) = 30, elsewhere. By the way, this is piece wise function.

Does this example work?

Also for A = {1/n: n is natural number) Does f(n) = 10 if 1/n is natural number and f(n) = 0, elsewhere work?

2. Nov 21, 2013

### R136a1

That will also be discontinuous in $0$ and $1$.

That will be discontinuous in $0$.

3. Nov 21, 2013

For the first one does make 10 elsewhere work?

For second one, does f(n) = 1/n where n is natural number and 0 elsewhere work?

Last edited: Nov 21, 2013
4. Nov 22, 2013

### pasmith

That fails to be continuous at 0 and 1.

You need $\displaystyle\lim_{x \to 0} f(x) = f(0)$ and $\displaystyle\lim_{x \to 1} f(x) = f(1)$. If you just assign different constants to rational and irrational numbers then those limits will not exist and your function will not be continuous at 0 and 1.

For f to be continuous at 0, you must have $\displaystyle\lim_{n \to \infty} f(1/n) = f(0)$.

Last edited: Nov 22, 2013
5. Nov 22, 2013

### SqueeSpleen

I think you can use an idea similar to this:
http://en.wikipedia.org/wiki/Thomae's_function
But irrationals have to have other value, then you may have a function that is continous only in the extremes.

6. Nov 22, 2013

### PeroK

For the first one, you need f to be continuous at 0 and 1. This is a problem for x in (0,1), where you need both rationals and irrationals to be heading towards the same limit.

So, how can you do that?

Suppose, for example, f(0) = 0 and f(1) = 1. And f(x) = x on the irrationals in (0, 1) and everything outside (0, 1).

Then, how can you define f on the rationals within (0,1)?

You need lim q -> 0 f(q) = 0 and lim q -> 1 f(q) = 1.

7. Nov 22, 2013

### shortydeb

Here's an idea for the first part:

Split (1/2, 1) into a countable number of subintervals. Specifically, (1/2, 3/4), (3/4, 7/8), (7/8, 15/16), etc. Let the functional value for all the irrationals in (1/2, 1) be zero. Let the functional value for the rationals in each subinterval be (1/n), i.e. the functional value for the rationals in (1/2, 3/4) is 1/1, the functional value for the rationals in (3/4, 7/8) is 1/2, etc.

8. Nov 23, 2013

### PeroK

That would work, but you don't need to do anything so complicated. 1-q on the rationals in (1/2, 1) would do in this case!