Let $f(x)= \begin{cases} \sin\left(\frac{1}{x}\right) \text{ for } 0<x\leq 1\\ 0 \text{ for } x=0 \end{cases}$
Show $f\notin \overline{S[0,1]}$, where $S[a,b]$ denotes the set of all step functions on the interval $[a,b]$, and the overline denotes the closure.
Thoughts/Remarks:
- $S[0,1]$ is a subalgebra of $B[0,1]$ (all bounded functions on the interval $[0,1] )$
- $f$ is bounded and hence $f\in B[0,1]$
- $\overline{S[a,b]}$ is a closed set
- The right and left handed limits of $f$ exist at every point $x\in[a,b]$ in order for $f$ to be in the closure of $S[a,b]$, so maybe a proof by contradiction might work. Something along the lines of: Suppose $f\in \overline{S[a,b]}.$ Then the right and left handed limits of $f$ exists at every point in our interval. Then showing that a certain limit doesn't exist would conclude the proof, but I'm not sure how to go about finding which limit fails to exist. Presumably it'd be where the functions differ, since $\sin\left(\frac{1}{x}\right)$ is continuous and so is the zero function. So probably the limit that fails is at $x=0 \text{ (from the right side)}$
$\lim_{x\to 0^+}f(x)=\lim_{x\to 0^+}\sin \left(\frac{1}{x}\right)$, which doesn't exist since it oscillates infinitely from the right as we approach zero.
Not sure if this is a good enough. I feel like I am not being rigorous enough. Any hints would be appreciated. Thanks.
Any step function is of the form $$ s(x)=\sum_{k=1}^na_k\,\chi_{[x_{k-1},x_k]}(x), $$ where $0=x_0<x_1<\dots<x_n=1$ is a partition of $[\,0,1\,]$ and $\chi_A$ is the characteristic function of the set $A$. Then $$ \sup_{0\le x\le1}|f(x)-s(x)|\ge\sup_{0\le x\le x_1}|\sin\Bigl(\frac1x\Bigr)-a_1|\ge\min(|a_1|,|1-a_1|)>0. $$