# Continuity at a point implies continuity in the neighborhood

Tags:
1. Apr 18, 2015

### Happiness

I claim that if a function $f:\mathbb{R}\rightarrow\mathbb{R}$ is continuous at a point $a$, then there exists a $\delta>0$ and $|h|<\frac{\delta}{2}$ such that $f$ is also continuous in the $h$-neighbourhood of $a$.

Continuity at $a$ means this: for every $\epsilon>0$, there exists a $\delta>0$ such that $|x-a|<\delta \implies|f(x)-f(a)|<\epsilon$. --- (*)

We want to show this: for every $\epsilon'>0$, there exists a $\delta'>0$ such that $|x-(a+h)|<\delta' \implies|f(x)-f(a+h)|<\epsilon'$.

If we let $\delta'$ = $\delta-|h|$ and $\epsilon=\frac{\epsilon'}{2}$, we will have $|x-(a+h)|<\delta' \implies|x-a|<\delta\implies|f(x)-f(a)|<\epsilon\implies|f(x)-f(a+h)|<\epsilon'$

The details:

$|x-(a+h)|<\delta'$
$|x-(a+h)|<\delta-|h|$
$-\delta+|h|<x-a-h<\delta-|h|$
$-\delta\leq-\delta+|h|+h<x-a<\delta-|h|+h\leq\delta$
$|x-a|<\delta$

By (*),

$|f(x)-f(a)|<\epsilon$
$-\epsilon<f(x)-f(a)<\epsilon$
$-\epsilon<f(x)-f(a+h)+f(a+h)-f(a)<\epsilon$
$-\epsilon-f(a+h)+f(a)<f(x)-f(a+h)<\epsilon-f(a+h)+f(a)$ --- (**)

By (*), when $x=a+h$,

$\mid a+h-a\mid\,=\,\mid h\mid\,<\delta\implies\,\mid f(a+h)-f(a)\mid\,=\,\mid-f(a+h)+f(a)\mid\,<\epsilon$

Substituting this into (**), we get

$-2\epsilon<f(x)-f(a+h)<2\epsilon$
$\epsilon'<f(x)-f(a+h)<\epsilon'$

Last edited: Apr 18, 2015
2. Apr 18, 2015

### lavinia

Consider the function

$$f(x) = x^2$$ for x a rational number and
$$f(x) = 0$$ for x an irrational number.

This function is continuous at zero. But it is not continuous anywhere else.

Last edited: Apr 18, 2015
3. Apr 18, 2015

### Happiness

@lavinia

For that function, am I right to say that it is only continuous at $x=0$ and in its immediate neighbourhood but not anywhere else?

4. Apr 18, 2015

### Staff: Mentor

No. The function Lavinia gave is continuous only at x = 0. "Immediate neighborhood" implies that for some δ > 0, the function is continuous at a point x within δ of 0.

5. Apr 18, 2015

### WWGD

Here is a problem I see. I added a !!!!!~~~~~~~~~~~~~~~~~~~~~ to your post to indicate the place. You seem to be canceling out -|h| with h , which does not hold if/when h is negative. In your layout, we only have $|h| < \delta$.

6. Apr 18, 2015

### Happiness

If $h$ is negative, then $\delta-|h|+h<\delta-|h|<\delta$. So this is still valid.

But there is another problem. We need to ensure that $0<\delta-|h|+h$. So we would require $|h|<\frac{\delta}{2}$.

7. Apr 18, 2015

### Staff: Mentor

@Happiness, Lavinia's example serves as a counterexample to your proof. The basic premise of your proof is flawed -- it can't be fixed.

8. Apr 18, 2015

### Happiness

@Mark44, I'm trying to analyse Lavinia's example. But in the meantime, what's wrong with my proof?

9. Apr 18, 2015

### Staff: Mentor

There's not much to analyze in Lavinia's example.

Lavinia's example negates your claim, so it's pointless to try to continue with it. For her example, f is continuous at only a single point, and not in any neighborhood of positive diameter around x = 0.

10. Apr 18, 2015

### Happiness

Could you show me explicitly how Lavinia's example is not continuous at points other than 0? I'm not very good at this.

I'm not trying to save my claim. I'm trying to learn from my mistake. So it's important to find where exactly my mistake is.

11. Apr 18, 2015

### WWGD

Basically, $h -|h| =0$. Try for the negative and positive cases. This does not work in your $\delta - \epsilon$ inequality; in your proof, it implies $- \delta <- \delta$. I don't know if it is _the_ problem, but it is a problem.

Last edited: Apr 18, 2015
12. Apr 18, 2015

### WWGD

Since $-|h|+h =0$ , your inequality becomes $\delta < \delta-|h| < \delta$.

13. Apr 18, 2015

### Happiness

I don't understand your point. $-|h|+h=0$ only if $h\geq0$.

$-\delta\leq-\delta+|h|+h<\delta-|h|+h\leq\delta$ looks fine to me in both the case $h<0$ and the case $h\geq0$.

14. Apr 18, 2015

### WWGD

Ah, sorry, I misread. But you do get a problem when $h > 0$ , getting $\delta < \delta -|h| < \delta$

15. Apr 18, 2015

### Staff: Mentor

I've drawn a crude picture that might help.
If f is continuous at x0, then for a given ε > 0, there exists a δ > 0 so that if x is within (x0 - δ, x0 + δ), then f(x) will be in (f(x0 - ε, f(x0 + ε).
In my drawing, suppose some ε has been chosen. The band along the y axis depicts the interval (f(x0 - ε, f(x0 + ε). What δ can we specify so that for any choice of x in (x0 - δ, x0 + δ), the interval I have marked along the x-axis, f(x) will be in the desired interval on the y-axis.

The answer is, we can't. For many of the x values in the interval along the x-axis, the function value is zero, which is well outside the band on the vertical axis.

16. Apr 18, 2015

### Staff: Mentor

To go along with the image in my last post, let's take x0 = 1, which is a rational number, so f(x0) = 1. I choose ε = .04. So the interval along the y-axis is (.96, 1.04). Your job is to find a positive number δ for which every number in (1 - δ, 1 + δ) is mapped to the interval (.96, 1.04) on the y-axis.

Since I picked .04 for ε you might be tempted to take δ = .2 (.04 happens to be the square of .2). Now, does every number in the interval (.8, 1.2) map to the interval (.96, 1.04)? Some do and some don't. If x is a rational number between .8 and 1.2, then yes, its image is in the interval (.96, 1.04). However, if x is any irrational number between .8 and 1.2, then its image is 0, which is not between .96 and 1.04. In fact, there is no such δ that can be found, as long as x ≠ 0.

Hope that helps.

17. Apr 18, 2015

### Happiness

Thanks a lot! Excellent explanation! Now I need to study my proof to see where I went wrong.

18. Apr 18, 2015

### Happiness

Where did you get $\delta < \delta -|h| < \delta$?

It should be $-\delta\leq-\delta+|h|+h<\delta-|h|+h\leq\delta$.

Suppose $h=-\frac{\delta}{3}$ (a negative number), then we have

$-\delta\leq-\delta+\frac{\delta}{3}-\frac{\delta}{3}<\delta-\frac{\delta}{3}-\frac{\delta}{3}\leq\delta$
$-\delta\leq-\delta<\frac{\delta}{3}\leq\delta$

which is valid.

Last edited: Apr 18, 2015
19. Apr 18, 2015

### Staff: Mentor

So given an ε by someone else, you have to come up with the δ. I don't see any evidence of that in your work. In the line below, you seem to be taking the existence of such a δ for granted. The δ that you find depends on the ε that someone else gives you.

Think about this δ-ε as a sort of dialogue between you and someone who is not your friend. Since this person is not your friend, he's not motivated to do you any favors. He's likely to give you the smallest number he can think of, and challenge you to find a δ that works.

Non-friend: I choose ε = .001
You (after a bit of work): OK, then δ = .05 works

Non-friend: Hmmph! All right, how about ε = .0001?
You (a bit later): No problem. δ = .002 works

Etc.
After the non-friend realizes that no matter how smal a number he chooses for ε, you outsmart him and come up with a value for δ that works. He gives in, and cedes that the limit must be what you say it is.

20. Apr 18, 2015

### Happiness

The existence of $\delta$ is guaranteed by the continuity of $f(x)$ at $x=a$. Isn't it?

And isn't it acceptable for $\delta=\delta(\epsilon)$, that is, for $\delta$ to be a function of $\epsilon$?

I've shown that $\delta'(\epsilon')=\delta(\epsilon)-|h|=\delta(\frac{\epsilon'}{2})-|h|$.

Since $h=h(\delta)$, we have $\delta'(\epsilon')=\delta(\frac{\epsilon'}{2})-|h(\delta(\frac{\epsilon'}{2}))|$.

Last edited: Apr 18, 2015