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.