I'd like to know a sufficient condition for guaranteeing the following result:
If $f$ is uniformly continuous on $A$ and is uniformly continuous on $B$, then $f$ is uniformly continuous on $A \cup B.$
In general, the above is false. But, for some cases, it is true. For example, $f$ is uniformly continuous on $[0,1]$ and is uniformly continuous on $[1,2],$ then, clearly, $f$ is uniformly continuous on $[0,1] \cup [1,2]=[0,2].$
Are there any result to extend the above example for functions from a metric space to a metric space?
Please let me know if there are any comment or answer for the question.
Thanks in advance!
OK so here was my first attempt: 'No further conditions are necessary. The definition of uniform continuity is this. Let $\epsilon>0$. Then there exists $\delta>0$ such that $|x-y|<\delta \Rightarrow |f(x)-f(y)|<\epsilon$. By assumption there is a $\delta$ for interval $A$, and another for $B$, so pick the lower of the two.' Not so, because $x$ could be from $A$ and $y$ from $B$.
If $A$ and $B$ are distance at least $d$ apart, i.e. the inf of the distance between a point in $A$ and one in $B$ is $d>0$, then you are OK, because if $\delta<d$ then the points $x,y$ (as in the above argument) must be both in $A$ or both in $B$.
If $A,B$ have a point in common then again you are OK because you can use the triangle inequality: let $z\in A \cap B$, and then $|f(x)-f(y)| < |f(x)-f(z)| + |f(z)-f(y)| < \epsilon/2 + \epsilon/2$, etc.