Consider the subsets $A= \{ (x, \frac {1}{x}) ~|~x \in \mathbb R - \{0\}\},~~B = \{(x,0)~|~x \in \mathbb R \}$ of $\mathbb R^2$ with the euclidean metric.
Define $f: A \bigcup B \rightarrow \mathbb R$ such that $f(A)=1, f(B)=0$.
Is $f$ uniformly continous on its domain? Is it continuous on its domain?
Attempt: Both $A$ and $B$ are closed in $\mathbb R^2$ and $\bar A \bigcap \bar B = \phi$. But $dist(A,B)= \inf \{d(a,b)~|~a\in A, b \in B\} = 0$.
$f$ being a individual constant function on $A$ and $B$ respectively, $f$ is uniformly continuous on each of $A$ and $B$ .
But $f$ is not uniformly continuous on $A \bigcup B$ because $~\forall x > \frac {1}{\delta}~~, \delta \in \mathbb R^+$, the distance between the sets $A= \{ x, \frac {1}{x} ~|~x \in \mathbb R - \{0\}\}$ and $~~B =\{(x,0)~|~x \in \mathbb R \}$ is less than $\delta$ and the distance between their images under $f$ is $1$.
$f$ is not continuous on $A \bigcup B$ for the same reason.
Am I correct in my approach? Thanks a lot!
$f$ is continuous on its domain, with the reason being that for each point $\vec x \in A\cup B$, one may find a sufficiently small neighborhood, say $D$, about $\vec x$ so that all of the points in $D$ will lie either entirely in $A$ or entirely in $B$ (depending on which one $\vec x$ lies in.)
If $\vec x = (N, \frac{1}{N})\in A$, choose $\delta=\frac{1}{2N}$. Here, you could picture the neighborhood $D$ as being all of the points in $A\cup B$ that intersect a circle about the point $\vec x$ with radius $\frac{1}{2N}$. However, the points in $B$ cannot lie in $D$ since the closest point on the x-axis (i.e. in $B$) is $(N,0)$, and they have a vertical separation of twice $\delta$. Here, $N$ is arbitrary, so this works for any point on $A$, even those with arbitrarily large x-coordinates.
The same choice of $\delta$ works for the point $\vec x=(N,0) \in B$, but this time the "circle" is centered about a point on the x-axis and reduces to an interval piece of $B$.
The reason uniform continuity fails, as you have shown, is that $A$ and $B$ become arbitrarily close and thus any fixed-size neighborhood will eventually intersect both $A$ and $B$ for large enough $N$. Continuity is weaker in that these neighborhoods may be chosen for each $\vec x$ as above.