Can you tell me if the following proof is correct?
Claim:
If $f$ is a continuous and compactly supported function from a metric space $X$ into $\mathbb{R}$ then $f$ is uniformly continuous.
Proof:
The proof is in two parts. First we want to show that $f$ is uniformly continuous on $K := \operatorname{supp}{f}$:
Let $\varepsilon > 0$. Because $f$ is continuous we have that for each $x$ in $K$ there is a $\delta_x$ such that for all $y$ with $d(x,y) < 2 \delta_x$ we have $|f(x) - f(y)| < \varepsilon$ and because $\{ B(x, \frac{\delta_x}{2}) \}_{x \in K}$ is an open cover of $K$ there is a finite subcover which we denote $\{ B(x_i, \frac{\delta_i}{2}) \}_{i=1}^n$. Define $\delta := \min_i \frac{\delta_i}{2}$ and let $x$ and $y$ be any two points in $K$ with $d(x,y) < \delta$. $\{ B(x_i, \frac{\delta_i}{2}) \}_{i=1}^n$ is a cover so there exists an $i$ such that $x$ is in $B(x_i, \frac{\delta_i}{2})$ which means that $d(x,x_i) < \frac{\delta_i}{2}$. Then $d(x_i ,y) \leq d(x_i ,x) + d(x,y) < \frac{\delta_i}{2} + \delta \leq \delta_i$ hence $y$ is also in $B(x_i, \delta_i)$.
Since $d(x_i,y) < \delta_i$ and $d(x, x_i) < \delta_i$ we have $|f(x) - f(y)| \leq |f(x) - f(x_i)| + |f(x_i) - f(y)| < 2 \varepsilon$.
Next we want to show that if $f$ is uniformly continuous on $K$ then it is uniformly continuous on all of $X$:
Let $\varepsilon > 0$. For any two points $x$ and $y$ we're done if either both are in $K$ or both are outside $K$ so let $x \in X \setminus K$ and $y \in K$ with $d(x,y) < \delta$. Then there is an $i$ such that $y$ is in $B(x_i, \frac{\delta_i}{2})$. Then $d(x,x_i) \leq d(x,y) + d(y,x_i) < \delta_i$ and hence $|f(x) - f(y)| \leq |f(x) - f(x_i)| + |f(x_i) - f(y)| < 2 \varepsilon$.
Is it necessary to prove this in two parts or is the second part "obvious" and should be left away?
Thanks for your help.