An example of a bounded, continuous function on $(0,1)$ that is not uniformly continuous

I can not find the example of a continuous function on $(0,1)$ that is bounded on $(0,1)$, but not uniformly continuous on $(0,1)$. Is there any? Thank you.


If you are not aware of the result mentioned in the example of @Tomek Kania,Here is elementary approach to prove that $\sin (\frac{1}{x})$ is not uniformly continuous on $(0,1)$. $$f(x) = \sin\left(\frac{1}{x}\right).$$ It is certainly bounded. However, it is not uniformly continuous. Given $\epsilon=\frac{1}{4}$, for any $\delta\gt 0$ we can find a large enough value of $n$ so that $$\frac{2}{(2n+1)\pi} - \frac{1}{2n\pi} = \frac{4n - (2n+1)}{2n(2n+1)\pi} = \frac{2n-1}{2n(2n+1)\pi}\lt \delta,$$ yet $$f\left(\frac{2}{(2n+1)\pi}\right) =\sin\left(\frac{(2n+1)\pi}{2}\right) = \pm 1,$$ and $$f\left(\frac{1}{2n\pi}\right) = \sin(2n\pi) = 0,$$ so letting $x=\frac{2}{(2n+1)\pi}$ and $y=\frac{1}{2n\pi}$, we have $$|x-y|\lt\delta\text{ but }|f(x)-f(y)| \geq \epsilon.$$


Take $$f(x) = \sin 1/x.$$

It is not uniformly continuous as such functions admit continuous extension to the closure of the domain. Here we don't have such extension as there are two sequences $(x_n)$ and $(y_n)$ in $(0,1)$ that tend to 0 such that $f(x_n)=1$ and $f(y_n)=0$ for all $n$.