Question on the extending uniform continuity. Let X be a metric space and A and B are two subset of X such that $A \cup B=X$. Let $f_1:A\to \mathbb{R}$ and $f_2:B\to\mathbb{R}$ be two uniform continuous functions such that $f_1=f_2$ on $A\cap B$. Then can we say the function $f:X\to \mathbb{R}$ defined $f=f_1$ on A and $f=f_2$ on B is uniform continuous?
Edit : (Sorry, I add one condition $A\cap B \ne \varnothing$)
My main concern for asking this question is the following.
X : metric space, $f :X \to \mathbb{R}$ is continuous function which has compact support. Then can we say $f$ is uniform continuous?
In this question, let $S$ be the support of this function and I took $A=\bar{S}$ and $B=
S^c$ and generalized this to the above question.
 A: Consider $X=\mathbb R$, $A=(-\infty,0]$, $B=(0,\infty)$.
EDIT: After you added the condition that $A\cap B\ne \emptyset$, the answer is still "no". Just replace $B$ with $(0,\infty)\cup\{-1\}$ in my first reply. Then $$f(x)=\begin{cases}x+1&\text{if }x\le 0\\ 0&\text{if }x>0\end{cases}$$
is not even continuous, but $f|_A$ and $f|_B$ are uniformly continuous.

Now for your main concern:
Let $X$ be a metric space, $f\colon X\to \mathbb R$ continuous with compact support $K$.
Then $f$ is uniformly continuous:
For each $\epsilon>0$ and $x\in K$ there exists $\delta=\delta(x)>0$ such that $d(x,y)<\delta$ implies $|f(x)-f(y)|<\frac12\epsilon$. By compactness, finitely many of the open balls  $B(x,\frac12\delta(x))$ suffice to cover $K$, say $K\subseteq \bigcup_{i=1}^nB(x_i,\frac 12\delta(x_i)) $. Let $\delta=\min\{\,\frac13\delta(x_i)\mid 1\le i\le n\,\}$. Then for $x,y\in X$ with $d(x,y)<\delta$ we have one of the following cases:


*

*$x,y\notin K$. Then $|f(x)-f(y)|=0<\epsilon$ as required.

*$x\in K$. Then for some $1\le i\le n$ we have $x\in B(x_i,\frac12\delta(x_i))$, hence $d(x_i,y)\le d(x_i,x)+d(x,y)<\frac12\delta(x_i)+\delta\le \delta(x_i)$. We conclude $|f(x)-f(y)|\le |f(x)-f(x_i)|+|f(y)-f(x_i)|<\epsilon$ as required.

*$y\in K$. Same as above, by symmetry.

A: No, consider $A=\mathbb{Q}$, $B=\mathbb{R}\setminus\mathbb{Q}$, $f_1: x\mapsto 1$ and $f_2: x\mapsto 2$.
If $A,B$ are open subsets of $X$:
Then $f$ is continuous, because continuity is a local property of a function: Just let $\epsilon$ be small enough to let the ball $B_\epsilon(x)$ contained in $A$ or $B$.
This holds also for arbitrary sets of subsets and $X$ being a topological space.
Then $f$ is uniform continuous, because you can choose $d(\epsilon)=\min(d_A(\epsilon),d_B(\epsilon))$. This holds also for finite sets of subsets and $X$ being a uniform space.
EDIT: If $A$ is compact, $B$ open and $f$ continous:
Then you can find an open, relatively compact subset $\tilde{A}\supseteq A$. Take $\tilde{f}_1 = f|_\tilde{A}$, which is a continuous function on a relatively compact space, therefore uniform continuous. Now you can use the first case.
EDIT2: Consider $X=S^1$, $A=e^{i[0,\pi]}$, $B=e^{i[\pi,2\pi)}$ and $f:e^{i\phi}\mapsto \phi$ (for $\phi\in[0,2\pi)$). So your new condition is still not enough.
