What would be an example of a function that is continuous, but not uniformly continuous?

Will $f(x)=\frac{1}{x}$ on the domain $(0,2)$ be an example? And why is it an example?

Please explain strictly using relevant definitions.


Clearly $\,\displaystyle{\frac{1}{x}}\,$ is continuous in $\,(0,2)\,$ as it is the quotient of two polynomials and the denominator doesn't vanish there.

Now, if the function was uniformly continuous there then

$$\forall\,\epsilon>0\,\,\exists\,\delta>0\,\,s.t.\,\,|x-y|<\delta\Longrightarrow \left|\frac{1}{x}-\frac{1}{y}\right|<\epsilon$$

But taking $\,\epsilon=1\,$ , then for any $\,\delta>0\,$ we take

$$x:=\min(\delta,1)\,\,,\,y=\frac{x}{2}\Longrightarrow |x-y|=\frac{x}{2}<\delta, \,\text{but nevertheless}$$

$$\left|\frac{1}{x}-\frac{1}{y}\right|=\left|\frac{1}{x}-\frac{2}{x}\right|=\left|\frac{1}{x}\right|\geq 1=\epsilon$$