Let $f$ be uniformly continuous on $I$ and uniformly continous on $J$ where $I$ and $J$ are intervals, such that $I\cap J=\emptyset$. I want to find a function such that $f$ is not uniformly continuous on $I\cup J$.
I tried the function $f(x)=0$ if $x<0$ and $f(x)=1$ if $x\ge0$. Taking the intervals $(-\infty, 0)$ and $(0,+\infty)$ it still doesn't seem to work. Any tips?