# A counter example on uniform continuity

Let $$f:(0,1]\rightarrow \mathbb{R}$$ be a continuous function and bounded is it uniformly continuous?

I know this isn't true, but I can't find a good counter example I was thinking something like this

$$f(x)=\min\{3,1/x\}$$ can someone give a better example.

• Have some wave that oscillates really fast near the origin, e.g. $\sin(1/x)$ – jlammy Jan 24 at 14:40

You can simply take $$f(x)=\sin\left(\frac1x\right)$$. It is not uniformly continuous because, for any $$\delta>0$$, there are $$x,y\in(0,1]$$ such that $$|x-y|<\delta$$ and that $$\bigl|f(x)-f(y)\bigr|=2$$.
You example $$f(x)$$ doesn't work, i.e. $$f(x)$$ is uniformly continuous on $$(0,1]$$. This is because it extends to a continuous function on $$[0,1]$$ by defining $$f(0)=3$$, and all continuous functions on closed and bounded intervals (or compact sets) are automatically uniformly continuous.
As for an actual example, someone else has already suggested $$\sin(1/x)$$, so see their answer.