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$.