[Math] A continuous function that is uniformly continuous on two sets, but not uniformly continuous on the union of these two sets

real-analysis

This homework problem has just cost me 3 hours… But I still have no clue what it can be…

Let $A, B \subseteq \mathbb{R}$. Find a continuous function $f:A\cup B \to \mathbb{R}$ where $f$ is uniformly continuous on $A$ and on $B$, but $f$ is not uniformly continuous on $A\cup B$.

Best Answer

Hint: take $A=\mathbb N$ and $B=\{n+\frac{1}{n}\left|\right.n\in\mathbb N,n\geq 2\}$.