Let $(X, d)$ and $(Y, d^{'})$ be metric spaces, $A, B\subset X$ subspaces such that $X=A\cup B$. Suppose $$f:(A, d_A)\longrightarrow (Y, d^{'})\quad \textrm{and}\quad g:(B, d_B)\longrightarrow (Y, d^{'}),$$ are both uniformly continuous such that $f|_{A\cap B}=g|_{A\cap B}$. Is it true that $h:(X, d)\longrightarrow (Y, d^{'})$ given by $$h(x)=\left\{\begin{array}{ccl} f(x)&\textrm{se}&x\in A\\ g(x)&\textrm{se}&x\in B\end{array}\right.$$ is also uniformly continuous?
What about the case $B=X\setminus A$ with $A$ compact? Finally, what if I suppose $h$ is continuous?
Notation: $d_A$ and $d_B$ are the restriction of the metric $d$ to the subspaces $A$ and $B$, respectively.
Obs: Maybe additional hypothesis will be needed.
Without connectedness we have the following counter example. Let $A = (-\infty,0)$ and $B = (0,\infty)$. Let $f : A \to \Bbb{R}$ and $g : B \to \Bbb{R}$ be given by $f \equiv 0$ and $g \equiv 1$. Then $X = A\cup B = \Bbb{R} \backslash \{0\}$ and $$ h(x) = \begin{cases} 0 & x < 0 \\ 1 & x > 0 \end{cases} $$ which is not uniformly continuous.