Consider the following attempted proof of the statement that if $X$ is a compact subset of $\mathbb {R}$, then a continuous function $f:X\to \mathbb {R}$ is uniformly continuous. We use $B_{\epsilon}(x)$ to denote the open ball of radius $\epsilon$ about $x$.
I. Fix $\epsilon>0$. As $f$ is continuous for all $x\in X$ there exists $\delta_{x}$ such that if $y\in B_{\delta_{x}}(x)$, then $|f(x)-f(y)|<\epsilon/2$. Let $C=\left\{B_{\delta_{x}}|x\in X\right\}$. Note $C$ is an open cover of $X$.
II. By compactness of $X$ there exists a finite subcover $C'$ of $C$, which we index by the set $X'\subset X$.
III. Set $\delta=\min_{x\in X'}\delta_{x}/2$. Then if $\delta/4>|x-y|$, there exists $z\in X'$ such that $x,y\in B_{\delta_{z}}$.
IV. Thus as $|f(z)-f(x)|$ and $|f(z)-f(y)|$ are both less than $\epsilon/2$, by the triangle inequality $|f(x)-f(y)|<\epsilon$, so $f$ is uniformly continuous.
In the above proof, at which step was the first error made? Or is there none at all? The answer said that step III is wrong, but I don't know why.