If f is unformly continuous on two sets, show that f is also uniformly continuous on the union of two given sets

So my next question is again about uniform continuity. Can you give me hints, or (better) give the solution of the following exercise? Thank you very much :-)

Given two subsets A and B of $\mathbb R$ with A bounded from above (i.e., having an upper bound) and B bounded from below (i.e., having a lower bound), where sup A = inf B and sup A $\in$ A$\cap$ B

(1) Prove that A$\cap$ B = {sup A}

Now, take A and B as above. Let f : $\mathbb R$ $\rightarrow$ $\mathbb R$ and assume that f is uniformly continuous on A and on B.

(2) Prove that f is uniformly continuous on A $\cup$ B.

My try:

(1) Let $x$ $\in A\cap B$. Because sup A = inf B , $\text {inf B} \le x \le \text {sup A}$ implies $x = \text{sup A}$. I chose x arbitrary, so $A\cap B = \text {sup A}$

(2)???

-
Start by writing down what "uniformly continuous" means. –  Chris Eagle Oct 20 '12 at 23:03
Uniformly continuous means that given an epsilon > 0, a single delta>0 can be chosen that works simultaneously for all points c in A and B. –  MSKfdaswplwq Oct 20 '12 at 23:11

The definition says $\forall\varepsilon>0\ \exists\delta>0\cdots\cdots\cdots\cdots$. To prove that a function is uniformly continuous, you need to find $\delta$ as a function of $\varepsilon$ and prove that it's small enough. You know you've got $\delta_1$ that's small enough on one set and $\delta_2$ that's small enough on the other. Which one is smaller might depend on $\varepsilon$. However $\min\{\delta_1,\delta_2\}$ will be small enough on both sets.

Later note, per comments: Let's make $\delta_A$ small enough so that if $x,y\in A$ and $|x-y|<\delta_A$ then $|f(x)-f(y)|<\varepsilon/2$, and if $x,y\in B$ and $|x-y|<\delta_B$ then $|f(x)-f(y)|<\varepsilon/2$.

Let $\delta=\min\{\delta_A,\delta_B\}$.

If $x,y\text{ both}\in A$ or $\text{both}\in B$, and $|x-y|<\delta$ that does it, as above.

If $x\in A$ and $y\in B$, then the distances from $x$ to the boundary point $b$, and from $y$ to $b$, are less than $\delta$, so $$|f(x)-f(y)| \le|f(x)-f(b)|+|f(b)-f(y)|<\frac\varepsilon2+\frac\varepsilon2=\varepsilon.$$

So in all cases, $|x-y|<\delta$ implies $|f(x)-f(y)|<\varepsilon$.

-
@MichealHardy: Dont we have to talk about the connectedness of A and B? –  MSKfdaswplwq Oct 21 '12 at 11:36
Suppose we let $\delta=\min\{\delta_1,\delta_2\}$. Maybe the remaining issue is this: what if $|x-y|<\delta$ and $x\in A$ and $y\in B$. The argument I gave above works if $x,y\in A$ or $x,y\in B$. Let $b$ be that boundary point between $A$ and $B$, which, under your hypotheses, is a limit point of both sets. Then $x$ differs from $b$ by less than $\delta$ and $y$ differs from $b$ by less than $\delta$, so each of $f(x)$, $f(y)$ differs from $b$ by less than $\varepsilon$, so $|f(x)-f(y)|<2\varepsilon$. Not good enough, so here's what I propose to do: [out of space; continued below] –  Michael Hardy Oct 21 '12 at 21:55
Pick $\delta_1$, $\delta_2$ as in my answer, except make them small enough to guarantee $|f(x)-f(y)|<\varepsilon/2$ instead of $<\varepsilon$. That will take care of all three cases: both points in $A$, both in $B$, and one in $A$ and one in $B$. –  Michael Hardy Oct 21 '12 at 21:57

So the formal answer should be as follows?:

Part 1

Let $x$ $\in A\cap B$. Because sup A = inf B , $\inf B \le x \le \sup A$ implies $x = \sup A$. I chose x arbitrary, so $A\cap B = \sup A$

Part 2

f is uniformly continuous on A. This means that for every $\epsilon \gt 0$ there exists a $\delta_1 \gt 0$ such that $|x-y|\lt \delta_1$ implies $|f(x)-f(y)|< \epsilon$ for every $x,y$ $\in$ A. Let $\epsilon >0$ be given. Let $\delta_1$ = $g_1$($\epsilon$), which is small enough to work for the given $\epsilon$

f is uniformly continuous on B. This means that for every $\epsilon \gt 0$ there exists a $\delta_2 \gt 0$ such that $|x-y|\lt \delta_2$ implies $|f(x)-f(y)|< \epsilon$ for every $x,y$ $\in$ B. Let $\epsilon >0$ be given. Let $\delta_2$ = $g_2$($\epsilon$), which is small enough to work for the given $\epsilon$

Now consider $f$ on the domain of $A \cup B$. Let $\epsilon >0$ be given. Choose $\delta = \min\left \{\delta_1, \delta_2 \right \}$.

Because A and B are connected, and continuous functions preserve connected sets, we can use this $\delta$ for any given $\epsilon>0$.Namely, for every $\epsilon \gt 0$ there exists a $\delta =\min\left \{\delta_1, \delta_2 \right \} \gt 0$ such that $|x-y|\lt \delta=\min\left \{\delta_1, \delta_2 \right \}$ implies $|f(x)-f(y)|< \epsilon$ for every $x,y$ $\in$ $A\cup B$, concluding that f is uniformly continuous on $A \cup B$

-
I changed \text{sup A} to \sup A. That is standard. It doesn't just prevent italicization of "sup" it also provides proper spacing in things like $5\sup A$, and in a "displayed" setting, it affects positions of subscripts, thus: $\displaystyle\sup_{x\in A}$. And there's no reason for the $A$ to be within \text{}. Similarly I changed min to \min. –  Michael Hardy Oct 21 '12 at 17:07