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.
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: