Suppose $f$ is uniformly continuous on $X_1,X_2,...,X_n$.
Let $X=\cup_{i=1}^n X_i.$
Is $f$ necessarily uniformly continuous on $X$? Is $f$ even necessarily continuous on $X$?
Let $f$ be the constant function given by $f(x)=c$ $ $ where $c \in \mathbb{R}$
Let $X_i =[a_i,b_i)$
Then there is a $\delta>0$ such that for each $x_0 \in X_i$ and $|x-x_o|,$ $$|f(x)-f(x_o)|<\varepsilon$$
$$\Rightarrow |c-c|<\varepsilon$$
$$\Rightarrow0<\varepsilon$$
Now, consider $\cup_{n=1}^\infty X_i=[a_1,b_1)\cup[a_2,b_2)\cup...\cup[a_n,b_n)$
Can we say that there exists $\delta>0$ such that for each $x_0 \in X$ and $|x-x_o|,$ $$|f(x)-f(x_o)|<\varepsilon?$$
If the sets $X_i$ are compact, you will be in good shape. 0XLR gave a counterexample in $\mathbb R$ where one of the sets was not closed. Here is a counterexample where the sets are not bounded.
Let $$ X_1 = \{1,2,3,\dots\}, \\ X_2 = \left\{1+\frac{1}{1}, 2+\frac{1}{2}, 3+\frac{1}{3}, \dots\right\} $$ Set $f(x) = 0$ on $X_1$ and $f(x) = 1$ on $X_2$. Then $f$ is uniformly continuous on $X_1$ and on $X_2$, but not on $X_1 \cup X_2$.