Closure of space of simple functions in $L^\infty([a,b])$ Let $a,b\in\mathbb R$ and $L^\infty([a,b])$ be a space of all bounded functions $f:[a,b]\to\mathbb R$. It is a metric space with a metric function given by 
$$
d(f,g) = \sup\limits_{x\in[a,b]}|f(x) - g(x)|. 
$$
Let us say that the function $f\in L^\infty([a,b])$ is in the class $S$, i.e. $f\in S$ if there is a finite partition 
$$
\mathcal  T = \{a = t_0<t_1<\dots<t_n = b\}
$$
and a sequence of reals $c_0,\dots,c_{n-1}$ such that 
$$
f(t) = \sum\limits_{i=0}^{n-2}c_i1_{[t_i,t_{i+1})}(t)+c_{n-1}1_{[t_{n-1},t_n](t)}
$$
for all $t\in [a,b]$. I wonder if there is a nice characterization of $\bar S$, the closure of $S$ in $L^\infty([a,b])$. E.g. any continuous on $[a,b]$ function is in $\bar S$ - but it surely is much larger.
 A: The closure for the uniform norm of step functions is the space of functions which have left and right limit at each point of $(a,b)$ (right for $a$ and left for $b$). These functions are called  regulated functions. 
If $f$ is in the closure for the uniform norm of step functions, we fix $\varepsilon>0$. We can find a step function $f_1$ such that $||f-f_1||_{\infty}\leq \varepsilon$. Let $x_0\in (a,b)$. Then we can find $\eta>0$ such that $f_1$ is constant on $(x_0,x_0+\eta)$. If $x,y\in (x_0,x_0+\eta)$ then 
$$|f(x)-f(y)|\leq |f(x)-f_1(x)|+|f_1(x)-f_1(y)|+|f_1(y)-f(y)|\leq 2\varepsilon,$$
so by Cauchy's criterion $f$ has a right limit at $x_0$. A similar argument shows that $x_0$ has a left limit and that $a$ has a right limit, $b$ a left limit. 
Conversely, if $f$ is regulated, we fix $\varepsilon>0$. Then for all $x\in [a,b]$, we can find $\eta(x)>0$ such that if $y,z\in (x-\eta(x),x)\cup (x,x+\eta(x))$ we have $|f(x)-f(y)|<\varepsilon$. Let $I_n:=[a,b]\cap (x-\eta(x),x+\eta(x))$. Then $(I_x)_{x\in [a,b]}$ is an open cover of $[a;b]$, so exists a $\eta>0$ such that for all open interval $I\subset [a,b]$ of diameter $<\eta$ is contained in a set $I_x$. Let $(t_0,\ldots,t_m)$ a subdivision of $[a,b]$ such that $\max_it_{i+1}-t_i<\eta$, $x_i$ such that $(t_i,t_{i+1})\subset I_{x_i}$. Let $S=(a_1,\ldots,a_p)$ a subdivision containing $t_i$ and $x_i$. We have for all $y,z\in (a_i,a_{i+1})$: $|f(y)-f(z)|<\varepsilon$. Fix $c_j:=f\left(\frac{a_i+a_{i+1}}2\right)$ and $f_1$ the step function defined by $f_1(x)=c_j$ if $x\in (a_i,a_{i+1})$ and $f_1(a_i)=f(a_i)$. Then $||f-f_1||_{\infty}\leq \varepsilon$.
A: Here is a completely different proof of this result using transfinite induction. We assume familiarity with ordinals and also the standard fact that no uncountable well-ordering can be order embedded into the real line. 
Fix a function $f \colon [0,1] \to \mathbb{R}$ that has left and right limits at every point, and fix $\epsilon > 0$. We find a simple function $g$ with $||f-g||_\infty < \epsilon$. 
Begin with $x_0 = 0$. Choose $x_1 > x_0$ so that $x_1 \in [0,1)$ and $||f(x) - f(x_0)||_\infty < \epsilon$ on $[0, x_1]$. This is possible because $\lim_{x\to x_0^-} f(x)$ exists. Let $g(x) = f(x_0)$ on the interval $[x_0, x_1)$. 
Now choose $x_2 > x_1$ so that $x_2 \in [0,1)$ and  $||f(x) - f(x_1)||_\infty < \epsilon$ on $[x_1, x_2]$. This is possible because $\lim_{x\to x_\omega^+} f(x)$ exists.  Let $g(x) = f(x_0)$ on the interval $[x_1, x_2)$.
Continue in this way until $x_n$ is defined for all $n \in \omega$. Let $x_\omega = \lim x_n$.  Find an $m$ so that $||f(x) - f(x_\omega)||_\infty < \epsilon$ on $(x_m, x_\omega]$ and redefine $g(x)$ to be $f(x_\omega)$ on the interval $(x_m, x_\omega]$.  
If $x_\omega = 1$ then we are done. Otherwise, continue in this way, building $x_{\omega + 1}$, $x_{\omega + n}$, $x_{\omega + \omega}$, etc.  For successor ordinals, we use the existence of left hand limits, and for limit ordinals we use the existence of right hand limits.  At successor stages we extend the domain of $g$ to the right, and at limit stages we correct the values of $g$ on an interval that reaches the upper end of the current domain. 
This process must stop before we reach $x_{\omega_1}$, because the construction embeds a copy of the ordinals into $[0,1]$. So, at some point, we reach the point $x = 1$ and the construction of $g$ is complete.
Now, by induction on $\alpha$, when the stage for $x_\alpha$ is complete, the function $g$ is a simple function (a finite linear combination of characteristic functions of points and intervals). Therefore, when the construction ends, $g$ is a simple function, even if the stage when the construction ends is at a transfinite ordinal. 
