# How can I show that the function is continuous at [0,1)U(1,2]?

#### mathmari

##### Well-known member
MHB Site Helper
Hey!!! How can I show that the function
$$f=\left\{\begin{matrix} 0, \text{ if } x \in [0,1)\\ 1, \text{ if } x \in (1,2] \end{matrix}\right.$$
is continuous at $[0,1) \cup (1,2]$ using the definition of continuity?

A function $f:A \rightarrow \mathbb{R}$ is continuous at a point $x_0$:
$\forall ε > 0$, $\exists δ > 0$ such that $\forall x \in A$ with
$$|x-x_0|<\delta \Rightarrow |f(x)-f(x_0)|<\epsilon$$

How can I use this to show the continuity at the whole interval?

#### ThePerfectHacker

##### Well-known member
Re: How can I show that the function is contunuous at [0,1)U(1,2]?

By assumption the point $x_0$ in your definition is inside the domain of the function. Furthermore, it should say $|x-x_0|<\delta \text{ and }x\in \text{dom}(f) \implies |f(x)-f(x_0)| < \varepsilon$.

You want to show $f$ as you defined it is continuous. So pick a point $x_0\in [0,1) \cup (1,2]$ and show that the condition of being continuous is satisfied.

The proof is divided into two cases depending which interval $x_0$ belongs do. Let us say that $x_0 \in [0,1)$. In this case there exists $\delta > 0$ so that $x_0 + \delta < 1$. Show that this choice of delta works for any $\varepsilon$.

#### mathmari

##### Well-known member
MHB Site Helper
Re: How can I show that the function is contunuous at [0,1)U(1,2]?

By assumption the point $x_0$ in your definition is inside the domain of the function. Furthermore, it should say $|x-x_0|<\delta \text{ and }x\in \text{dom}(f) \implies |f(x)-f(x_0)| < \varepsilon$.

You want to show $f$ as you defined it is continuous. So pick a point $x_0\in [0,1) \cup (1,2]$ and show that the condition of being continuous is satisfied.

The proof is divided into two cases depending which interval $x_0$ belongs do. Let us say that $x_0 \in [0,1)$. In this case there exists $\delta > 0$ so that $x_0 + \delta < 1$. Show that this choice of delta works for any $\varepsilon$.
Let $\epsilon >0$
• $x_0 \in [0,1)$
In this case there exists $\delta > 0$ so that $x_0 + \delta < 1$. So could we take $\delta = 1-x_0$?
$\forall x: |x-x_0|< \delta=1-x_0$ (that means that $x$ bolongs to the first interval, so $f(x)=0$)
$|f(x)-f(x_0)|=|0-0|=0<\epsilon$
So the function is continuous at $[0,1)$

• $x_0 \in (1,2]$
In this case there exists $\delta > 0$ so that $x_0 - \delta > 1$. So $\delta = x_0-1$.
$\forall x: |x-x_0|< \delta=x_0-1$ (that means that $x$ bolongs to the second interval, so $f(x)=1$)
$|f(x)-f(x_0)|=|1-1|=0<\epsilon$
So the function is continuous at $(1,2]$

So we take $\delta=|1-x_0|$,to have one $\delta$ for all cases.

So the function is continuous at $[0,1) \cup (1,2]$.

Is this correct?

Last edited:

#### ThePerfectHacker

##### Well-known member
Yes that is correct.

#### mathmari

##### Well-known member
MHB Site Helper
Yes that is correct.
So do I have to write the definition of the continuity at each case and find then an $\delta$ that is different at each case, or do I have to find first the $\delta=|1-x_0|$ that is equal for both cases and then continue with the definition??

And something else..How can I show that the function is not uniformly continuous at $[0,1) \cup (1,2]$??

#### ThePerfectHacker

##### Well-known member
So do I have to write the definition of the continuity at each case and find then an $\delta$ that is different at each case, or do I have to find first the $\delta=|1-x_0|$ that is equal for both cases and then continue with the definition??
You can do it in one shot and just say to choose $\delta = |1-x_0|$, independent of the choice of $\varepsilon$.

And something else..How can I show that the function is not uniformly continuous at $[0,1) \cup (1,2]$??
Let $A = [0,1) \cup (1,2]$ to simplify notation.

Here is the definition of uniform continuity:
For every $\varepsilon > 0$ there exists $\delta > 0$ so that if $|x-y|<\delta \text{ and }x,y\in A$ then $|f(x)-f(y)| < \varepsilon$.

It may be helpful to write this in logical symbols:
$$\forall \varepsilon > 0 ~ \exists \delta > 0 ~ \forall x,y\in A, ~ |x-y| < \delta \implies |f(x)-f(y)| < \varepsilon$$

When you show something is not uniformly continuous you need to negate that sentence. Make sure you understand why this is the negated version:
$$\exists \varepsilon > 0 ~ \forall \delta > 0 ~ \exists x,y\in A, ~ |x-y| < \delta \text{ and } |f(x)-f(y)| \geq \varepsilon$$
In plain English you need to find an $\varepsilon$ so that for any choice of $\delta$ there will exist two numbers $x,y$ which are $\delta$ close but $f(x),f(y)$ are $\varepsilon$ apart. Try using $\varepsilon = \tfrac{1}{2}$. What is the motivation for choosing this number? Because the two levels of the function are at $1$ and $2$, the jump between them is $1$, so choosing a number smaller than $1$ will make the jump exceed the $\varepsilon$.

This is what you have to do. Show that for any $\delta > 0$ you can find $x,y\in A$ that are $\delta$ apart but $|f(x)-f(y)| \geq \tfrac{1}{2}$.

#### mathmari

##### Well-known member
MHB Site Helper
Here is the definition of uniform continuity:
For every $\varepsilon > 0$ there exists $\delta > 0$ so that if $|x-y|<\delta \text{ and }x,y\in A$ then $|f(x)-f(y)| < \varepsilon$.
And $\delta$ should be independent from $x_0$, or am I wrong?

In plain English you need to find an $\varepsilon$ so that for any choice of $\delta$ there will exist two numbers $x,y$ which are $\delta$ close but $f(x),f(y)$ are $\varepsilon$ apart. Try using $\varepsilon = \tfrac{1}{2}$. What is the motivation for choosing this number? Because the two levels of the function are at $1$ and $2$, the jump between them is $1$, so choosing a number smaller than $1$ will make the jump exceed the $\varepsilon$.

This is what you have to do. Show that for any $\delta > 0$ you can find $x,y\in A$ that are $\delta$ apart but $|f(x)-f(y)| \geq \tfrac{1}{2}$.
Is this the only way? Could I also use sequences to show that the function is not uniformly contnuous?

#### ThePerfectHacker

##### Well-known member
And $\delta$ should be independent from $x_0$, or am I wrong?
No, $\delta$ does not need to be independent from $x_0$. In general, when you prove continuity $\delta$ depends on $x_0$ and on $\varepsilon$. In this specific example that you did the $\delta$ turned out to actually be independent of $\varepsilon$, but that is not common.

Is this the only way? Could I also use sequences to show that the function is not uniformly contnuous?
I think going to the very definition is the way to do it, not with sequences.

#### mathmari

##### Well-known member
MHB Site Helper
No, $\delta$ does not need to be independent from $x_0$. In general, when you prove continuity $\delta$ depends on $x_0$ and on $\varepsilon$. In this specific example that you did the $\delta$ turned out to actually be independent of $\varepsilon$, but that is not common.
Isn't it as followed?

• $f:A \rightarrow R$ continuous
$\forall \epsilon>0, \exists \delta = \delta (\epsilon, x_0) >0: |x-x_0|< \delta \Rightarrow |f(x)-f(x_0)|< \epsilon$

• $f:A \rightarrow R$ uniformly continuous
$\forall \epsilon>0, \exists \delta = \delta (\epsilon) >0: \forall x,y \in A \text{ with }|x-y|< \delta \Rightarrow |f(x)-f(y)|< \epsilon$

I think going to the very definition is the way to do it, not with sequences.
I found the following solution in my textbook.

We suppose the sequences $x_n=1-\frac{1}{n+1}$ and $y_n=1+\frac{1}{n+1}$

We have that $x_n \in [0,1)$ and $y_n \in (1,2]$ and

$y_n-x_n=1+\frac{1}{n+1}-1+\frac{1}{n+1}=\frac{2}{n+1} \rightarrow 0$

But we have that $f(y_n)-f(x_n)=1-0=1 \nrightarrow 0$

That means that the function f is not uniformly continuous.

Could you explain me why we took these two sequences? Why didn't we check the uniformly continuity at each interval as we did with the continuity, but took a sequence of each interval instead?

#### ThePerfectHacker

##### Well-known member
• $f:A \rightarrow R$ continuous
$\forall \epsilon>0, \exists \delta = \delta (\epsilon, x_0) >0: |x-x_0|< \delta \Rightarrow |f(x)-f(x_0)|< \epsilon$
This is the definition of being continuous at $x_0$, not continuous on $A$. You should have wrote,
$$\forall x_0\in A ~ \forall \varepsilon > 0 ~ \exists \delta > 0, ~ |x-x_0|<\delta \text{ and }x\in A\implies |f(x)-f(x_0)| < \varepsilon$$
In your solution you wrote $\delta = |1-x_0|$ as the $\delta$ which works, note that it does not depend on $\varepsilon$, so $\delta(x_0,\varepsilon) = |1-x_0|$. I think it is bothering you since $\varepsilon$ is not present in the formula, in which case you can do something silly like writing $\delta(x_0,\varepsilon) = |1-x_0| + 0\cdot \varepsilon$.

I found the following solution in my textbook.

We suppose the sequences $x_n=1-\frac{1}{n+1}$ and $y_n=1+\frac{1}{n+1}$

We have that $x_n \in [0,1)$ and $y_n \in (1,2]$ and

$y_n-x_n=1+\frac{1}{n+1}-1+\frac{1}{n+1}=\frac{2}{n+1} \rightarrow 0$

But we have that $f(y_n)-f(x_n)=1-0=1 \nrightarrow 0$

That means that the function f is not uniformly continuous.

Could you explain me why we took these two sequences? Why didn't we check the uniformly continuity at each interval as we did with the continuity, but took a sequence of each interval instead?
Ignore the solutions in your book for the time being. Try to work out what we wrote above. And then we can figure out the book's solution.

#### solakis

##### Active member
Re: How can I show that the function is contunuous at [0,1)U(1,2]?

Let $\epsilon >0$
• $x_0 \in [0,1)$
In this case there exists $\delta > 0$ so that $x_0 + \delta < 1$. So could we take $\delta = 1-x_0$?
$\forall x: |x-x_0|< \delta=1-x_0$ (that means that $x$ bolongs to the first interval, so $f(x)=0$)
$|f(x)-f(x_0)|=|0-0|=0<\epsilon$
So the function is continuous at $[0,1)$

• $x_0 \in (1,2]$
In this case there exists $\delta > 0$ so that $x_0 - \delta > 1$. So $\delta = x_0-1$.
$\forall x: |x-x_0|< \delta=x_0-1$ (that means that $x$ bolongs to the second interval, so $f(x)=1$)
$|f(x)-f(x_0)|=|1-1|=0<\epsilon$
So the function is continuous at $(1,2]$

So we take $\delta=|1-x_0|$,to have one $\delta$ for all cases.

So the function is continuous at $[0,1) \cup (1,2]$.

Is this correct?

No it is not.

Any value of δ>0 will not effect the value of |f(x)-f(x_o)}| so that, it must be less than ε.

Since :$x_{o}\in [0,1)$ and $x\in [0,1)$ ,then we have :

$|f(x)-f(x_{o})|=|0-0|<\epsilon$ no matter what is the value of δ>0

#### Evgeny.Makarov

##### Well-known member
MHB Math Scholar
Re: How can I show that the function is contunuous at [0,1)U(1,2]?

No it is not.
Which line is incorrect? (I see a couple of small problems in mathmari's solution, but they are easy to fix.)

Any value of δ>0 will not effect the value of |f(x)-f(x_o)}| so that, it must be less than ε.

Since :$x_{o}\in [0,1)$ and $x\in [0,1)$ ,then we have :

$|f(x)−f(x_o)|=|0−0|<\epsilon$ no matter what is the value of δ>0
But why is $x\in [0,1)$? What if $x_0=0.9$, $\delta=1$ and $x=1.5$? Then $|x_0-x|<\delta$, but $f(x_0)\ne f(x)$.

#### solakis

##### Active member
Re: How can I show that the function is contunuous at [0,1)U(1,2]?

Which line is incorrect? (I see a couple of small problems in mathmari's solution, but they are easy to fix.)
Let us see.

Let $\epsilon >0$
• $x_0 \in [0,1)$
In this case there exists $\delta > 0$ so that $x_0 + \delta < 1$. So could we take $\delta = 1-x_0$?
$\forall x: |x-x_0|< \delta=1-x_0$ (that means that $x$ bolongs to the first interval, so $f(x)=0$)
$|f(x)-f(x_0)|=|0-0|=0<\epsilon$
So the function is continuous at $[0,1)$
By taking :

$\delta = 1-x_0$

We have:

$x_{o}-1<x-x_{o}< 1-x{o}\Longrightarrow 2x_{o}-1<x< 1$

But since $0\leq x_{o}<1$ that implies :

$-1\leq 2x_{o}-1<1$

Hence : -1<x<1 ,so x is not restricted within [0,1)

and we cannot conclude $|f(x)-f(x_{o}|<\epsilon$ and therefor that f is continous on [0,1)

• $x_0 \in (1,2]$
In this case there exists $\delta > 0$ so that $x_0 - \delta > 1$. So $\delta = x_0-1$.
$\forall x: |x-x_0|< \delta=x_0-1$ (that means that $x$ bolongs to the second interval, so $f(x)=1$)
$|f(x)-f(x_0)|=|1-1|=0<\epsilon$
So the function is continuous at $(1,2]$
In this case again the choice of delta is not correct you can check it up

#### Evgeny.Makarov

##### Well-known member
MHB Math Scholar
Re: How can I show that the function is contunuous at [0,1)U(1,2]?

Hence : -1<x<1 ,so x is not restricted within [0,1)
Yes, this is one of those small things that I would change. However, formally what you pointed out is not a problem. In posts #9 and #10 there was the following exchange.

Isn't it as followed?

• $f:A \rightarrow R$ continuous
$\forall \epsilon>0, \exists \delta = \delta (\epsilon, x_0) >0: |x-x_0|< \delta \Rightarrow |f(x)-f(x_0)|< \epsilon$
This is the definition of being continuous at $x_0$, not continuous on $A$. You should have wrote,
$$\forall x_0\in A ~ \forall \varepsilon > 0 ~ \exists \delta > 0, ~ |x-x_0|<\delta \textbf{ and }\pmb{x\in A}\implies |f(x)-f(x_0)| < \varepsilon$$
Wikipedia agrees with Hacker's definition:
Given a function $f$ as above and an element $c$ of the domain $I$, $f$ is said to be continuous at the point $c$ if the following holds: For any number $\varepsilon > 0$, however small, there exists some number $\delta > 0$ such that for all $x$ in the domain of $f$ with $c − \delta < x < c + \delta$, the value of $f(x)$ satisfies
$f(c) - \varepsilon < f(x) < f(c) + \varepsilon.$
Other sources can be checked, but I think this definition is reasonable. Thus, for $f(x)$ in this thread, $x$ ranges only in the domain of $f$ and thus cannot become less than $0$. However, I would still choose $\delta$ in such a way that if $x_0\in[0,1)$, then $|x-x_0|<\delta$ implies that $x\in [0,1)$, for example, $\delta=\min(x_0,1-x_0)$.

#### solakis

##### Active member
Isn't it as followed?

• $f:A \rightarrow R$ continuous
$\forall \epsilon>0, \exists \delta = \delta (\epsilon, x_0) >0: |x-x_0|< \delta \Rightarrow |f(x)-f(x_0)|< \epsilon$

• $f:A \rightarrow R$ uniformly continuous
$\forall \epsilon>0, \exists \delta = \delta (\epsilon) >0: \forall x,y \in A \text{ with }|x-y|< \delta \Rightarrow |f(x)-f(y)|< \epsilon$

I found the following solution in my textbook.

We suppose the sequences $x_n=1-\frac{1}{n+1}$ and $y_n=1+\frac{1}{n+1}$

We have that $x_n \in [0,1)$ and $y_n \in (1,2]$ and

$y_n-x_n=1+\frac{1}{n+1}-1+\frac{1}{n+1}=\frac{2}{n+1} \rightarrow 0$

But we have that $f(y_n)-f(x_n)=1-0=1 \nrightarrow 0$

That means that the function f is not uniformly continuous.

Could you explain me why we took these two sequences? Why didn't we check the uniformly continuity at each interval as we did with the continuity, but took a sequence of each interval instead?

The theorem connecting uniform continuity and sequences belonging in the domain of the function is the following:

Given f:A=>R where A is a subset of R ,then f is uniform continuous iff for every pair of sequence belonging in A we have:

$lim_ {n\to\infty} |x_{n}-y_{n}|=0\Longrightarrow lim_{n\to\infty} |f(x_{n}-f(y_{n}|=0$

Now if you like, you can show ,that proving the negation of the "for every pair of sequences belonging in A we have: $lim_ {n\to\infty} |x_{n}-y_{n}|=0\Longrightarrow lim_{n\to\infty} |f(x_{n}-f(y_{n}|=0$" part of the theorem,as your book did, we can prove not uniform continuity

Last edited:

#### solakis

##### Active member
No, $\delta$ does not need to be independent from $x_0$. In general, when you prove continuity $\delta$ depends on $x_0$ and on $\varepsilon$. In this specific example that you did the $\delta$ turned out to actually be independent of $\varepsilon$, but that is not common.

I think going to the very definition is the way to do it, not with sequences.

I tried for so long to find the appropriate delta ,but i could not.

Can you help ??