# Homework Help: Continuity on a piece-wise function

1. Nov 20, 2007

### varygoode

[SOLVED] Continuity on a piece-wise function

Problem:

Suppose:

$$f(x)=\left\{\begin{array}{cc}x^2, & x\in\mathbb{Q} \\ -x^2, & x\in\mathbb{R}\setminus\mathbb{Q}\end{array}\right$$

At what points is $$f$$ continuous?

Relevant Questions:

This is in a classical analysis course, not a real analysis course. So we use the metric defininition of continuity:

A function $$f:X \rightarrow Y$$, with $$X, Y$$ metric spaces and the distance between $$x, x_0 \in X, y, y_0 \in Y$$
denoted as $$d_X(x, x_0), d_Y(y, y_0)$$, respectively, is called $$continuous \ at \ a \ point \ x_0$$ if, $$\forall \ \varepsilon > 0 \ \exists \ \delta > 0$$ such that:

$$d_X(x, x_0) \leq \delta \Rightarrow d_Y(f(x), f(x_0)) \leq \varepsilon$$ ​

So, I'm just assuming that our distances are regular distance in $$\mathbb{R}$$, as this assumption is normal in my class when both sets are over subsets of $$\mathbb{R}$$.

Now, my question is as follows: should there be four cases here? One with both $$x, x_0$$ (as in the definition) in $$\mathbb{Q}$$, one with both in $$\mathbb{R}\setminus\mathbb{Q}$$, and two with one in each? Is there more, less? Am I looking at this the wrong way?

Solution Attempt:

I started doing it with the four situation case, and I was getting that it is continuous only when $$x, x_0 \in \mathbb{R}\setminus\mathbb{Q}$$. But I may be thinking about this all wrong.

Any ideas/suggestions/corrections/praise?

2. Nov 20, 2007

### quasar987

Another characterization of continuity that you will recognize from your real analysis course is that f is continuous at x0 iff for all sequences x_n that converge to x0, the sequence of images f(x_n) converges to x0.

In particular, if you can find a sequence such that x_n-->x0 but f(x_n) does not converge to f(x0), then you will have shown that f is not continuous at x0.

3. Nov 20, 2007

### varygoode

Where do you suggest I start?

I know a sequence of rationals exists that converges to an arbitrary real number; that's a widely-known theorem.

But I don't know what number I should try to make such a sequence to converge to in order to arrive at some concrete conclusion(s).

Also, any other ideas (especially using the given definition) would be just as great.

Thanks!

4. Nov 20, 2007

### quasar987

I don't what what more to say without giving it away. I'll just repeat my hint:

"If you can find a sequence such that x_n-->x0 but f(x_n) does not converge to f(x0), then you will have shown that f is not continuous at x0."

5. Nov 21, 2007

### HallsofIvy

You might try graphing that function! Actually, you can't graph individual rational and irrational values but you get basically the same thing by graphing y= x2 and y= -x2. That should make it obvious where your function is continuous!

6. Nov 21, 2007

### varygoode

Is it continuous only at 0?

This is interesting, indeed.

I think I can rule out it being continuous at any irrational point. Since I can always find a sequence of rationals (only) to converge to any real number, I can find (in particular) such a sequence to converge to any irrational. But then f(sequence of rationals) will stay positive, but f(irrational) will be the opposite of whatever it was. So, if the irrational is positive, it's opposite will be negative. So any sequence of all positive numbers won't converge to a negative number. But I'm not sure what's going on for a negative irrational.

Or for the rationals, for that matter.

But I get the feeling 0 may be the only continuous point here. Just I don't see why yet.

7. Nov 21, 2007

### quasar987

think some more about this and convince yourself that the argument you applied (my hint) for any point except 0.

then prove it is continuous at 0.

note: there is also an infinity of irrationnal numbers in any interval. (In fact, you could say that there are MORE irrationals than rationals in any interval because there are countably many rationals, but uncountably many irrationals)

8. Nov 21, 2007

### HallsofIvy

If x0 is not 0, then x02 is positive. Take $\epsilon= x_0^2/2$. Now, either x0 is rational or x0 is irrational.

If x0 is rational, then f(x0)= -x02. But, for any $\delta> 0$, there exist irrational x, with $|x- x_0|< \delta$. For such an x, f(x)= x2> 0 and so not within $\epsilon$ of f(x0).

I'll leave "if x0 is irrational" to you.