# Example of a locally non-injective, regular function

 Consider the function  $f:ℝ\to ℝ$ where

f is a sample function of the required kind, as we will show:

1. f is differentiable at 0 and  ${f}^{\prime }\left(0\right)=1$.

2. f fails to be one-to-one in every neighbourhood of 0.

Proof:

1. ►  The inequality

$0\le |{m}_{0}\left(x\right)-1|=|\frac{f\left(x\right)-f\left(0\right)}{x-0}-1|=|x\cdot \mathrm{cos}\frac{\mathrm{\pi }}{x}|\le |x|$

is obviously valid for all $x\ne 0$ so that the nesting theorem [6.9.10] yields $\underset{x\to 0}{\mathrm{lim}}|{m}_{0}\left(x\right)-1|=0$. According to [6.9.11] this is the assertion $\underset{x\to 0}{\mathrm{lim}}{m}_{0}\left(x\right)=1$.

2. ►  f is continuous (at 0 due to 1. and for $x\ne 0$ due to the calculation rules for continuous functions). Now for an arbitrary $k\in {ℕ}^{\ast }$ we consider the numbers

$\frac{1}{2k+2}<\frac{1}{2k+1}<\frac{1}{2k}$

They will satisfy

$f\left(\frac{1}{2k+1}\right)\underset{{\left[1\right]}}{<}f\left(\frac{1}{2k+2}\right)\underset{{\left[2\right]}}{<}f\left(\frac{1}{2k}\right)$

This assumed the intermediate value theorem ([6.6.2]) will provide an $\stackrel{˜}{x}\in \right]\frac{1}{2k+1},\frac{1}{2k}\left[$, in particular $\stackrel{˜}{x}\ne \frac{1}{2k+2}$, such that  $f\left(\stackrel{˜}{x}\right)=f\left(\frac{1}{2k+2}\right)$. But this proves that  f is not injective on $\right]-\frac{1}{2k},\frac{1}{2k}\left[$.

To validate [1] and [2] note that the cosine takes the value 1 for all even multiples of π, and the value −1 for all the odd ones. So we have

[1] is thus valid due to the following calculation:

$\begin{array}{ll}\hfill & f\left(\frac{1}{2k+1}\right)

For [2] we find a similar calculation:

$\begin{array}{ll}\hfill & f\left(\frac{1}{2k+2}\right)