Function oscillating between $[-1,1]$ around $0$.

759 Views Asked by At

I was looking for examples of functions $f:\mathbb{R}\to\mathbb{R}$ such that for any $a>0$ we have that $[-1,1]\subseteq f\left([-a,a]\right)$

The two examples I could think of were $\sin(1/x)$ and $\cos(1/x)$. However, I was wondering if there are other, interesting examples of such a function? Perhaps ones not involving trigonometric functions? I'd be grateful for some suggestions.

2

There are 2 best solutions below

1
On BEST ANSWER

If $-1\lt x\lt1$, and $x\ne0$, let the decimal expansion of $x$ be $x=\pm.000\dots0d_1d_2d_3\dots$ with $d_1\ne0$. Then let $f(x)=\pm.d_1d_2d_3\dots$. For $x=0$ and for $|x|\ge1$ the definition of $f$ is arbitrary. Then for every $a\gt0$ and for every $y$ in $[-1,1]$ there is an $x$ with $-a\lt x\lt a$ and $f(x)=y$.

0
On

Conway base 13 function comes to mind.

Indeed f takes on the value of every real number on any closed interval $[a,b]$ where $b > a$. (Wikipedia, Conway base 13 function)

So in particular for every $a\in\Bbb R$ we have $[-1,1]\subseteq\Bbb R\subseteq f([-a,a])$. Seems much more than just an oscillation around zero.