Let $f$ be a continuous mapping of a compact metric space $X$ into a metric space $Y$. Then $f$ is uniformly continuous on $X$.
Let $f:[0,2]\to[0,4]$ be defined by $x\to x^2$. How is this function uniformly continuous on $[0,2]$? Let $|a-x|<\delta$. Then $|a^2-x^2|=\delta|a+x|$. Hence, $|a^2-x^2|$ is not independent of $x$.