Denseness in $C_b([0,1])$ Let $X_n$ be the set if functions $f$ such that there exists $0\leq s_0<s_1<...< s_N=1$ such that $f$ is affine on $[s_j , s_{j+1}]$ with $\vert f'(t) \vert \geq n$ on $s \in (s_j,s_{j+1})$. Then it follows that $X_n$ is dense in $C_b([0,1])$.
Graphically this assertion is true (by drawing a highly oscillating zigzag graph in a narrow strip around the graph of $f$), but can someone give a formal proof of this?
 A: Let $g$ be a continuous function on $[0,1]$. Consider $g^+_n:=g+\frac5{n}$ and $g^-_n:=g-\frac5{n}$.
Now, by Heine-Cantor theorem, $g$ is uniformly continuous, so consider $N_n\in\Bbb N$ such that $N_n\ge n^2$ and for all $x,y$ with $\lvert x-y\rvert\le\frac1{N_n}$ holds $\lvert g(x)-g(y)\rvert<\frac126^{-n}$. If we call $$U_k^{n}:=\sup\left\{g(x)\,:\,x\in\left[\frac{k}{N_n},\frac{k+1}{N_n}\right]\right\}\\ L_k^{n}:=\sup\left\{g(x)\,:\,x\in\left[\frac{k}{N_n},\frac{k+1}{N_n}\right]\right\}$$ and $U_k^{n;+},\, L^{n;+}_k,\,U_k^{n;-}\,L_k^{n;-}$ the same thing for $g_n^+$ and $g_n^-$, the assumption means that $U_k^n-L_k^n<6^{-n}$ and, since $g_n^+$ and $g_n^-$ are translated of $g$, these inequalities hold $$ L_k^{n;-}\le U_k^{n;-}\le L_k^{n;-}+6^{-n}\le L^n_k-\frac5n+6^{-n}\le U^n_k-6^{-k}\le L^n_k\le\\\le U^n_k\le L_k^n+6^{-n}\le U_k^{n}+\frac5n-6^{-n}\le U_k^{n;+}-6^{-n}\le L_k^{n;+}\le U_k^{n;+}$$ 
Now, consider the sequence $s^n_k=\frac{k}{N_n}$ and the piece-wise affine function $f_n$ which interpolates, for all the suitable $t$, the point $\left(s^n_{2t},g^-_{n}(s^n_{2t})\right)$ with the point $\left(s^n_{2t+1},g^+_{n}(s^n_{2t+1})\right)$ and the point $\left(s^n_{2t+1},g^+_{n}(s^n_{2t+1})\right)$ with the point $\left(s^n_{2t+2},g^-_{n}(s^n_{2t+2})\right)$. The absolute value of each slope is $$N_n\cdot\left\lvert g_n^+(s^n_{2k})-g_n^-(s^n_{2t+1})\right\rvert>N_n\cdot\left( L^{n;+}_{2t}-U_{2t}^{n;-}\right)\ge N_n\cdot\left( U_{2t}^n+\frac5n-6^{-n}-U_k^n\right)\ge\\\ge 5n-n6^{-n}> 4n$$
Notice also that, for $x\in [s^n_k,s^n_{k+1}]$, it holds $L_k^{n;-}\le f_n(x)\le U_k^{n;+}$. So $$\lVert f_n-g\rVert_\infty\le\sup\{ U^{n;+}_k-L_k^{n;-}\,:\,0\le k\le N_n-1\}\le \frac{10}n-2\cdot 6^{-n}$$
This gives you a slight sharpening of the thesis, providing a sequence $f_n$ which converges uniformly to $g$ and such that $f_n\in X_n$ for all $n$.
A: (I). We may  re-name your $X_n$ as $X_n[0,1]$ and define $X_n[a,b]$ similarly for any $a,b$ with $a<b.$ This will be useful in what follows.
(II). Lemma. For any $a,b$ with $a<b,$ for any $c,d,$ for any $e>0,$ there exists continuous $f\in X_n[a,b]$ with $f(a)=c$ and $f(b)=d$ and $\min(c,d)\leq f(x)\leq \max (c,d)+e$ for all $x\in [a,b].$
Proof: Let $l:[a,b]\to [c,d]$ be linear with $l(a)=c$ and $l(b)=d.$ Take $N\in \mathbb N$ with $N$ even, and large enough that $$\frac {e}{(b-a)/N}-\frac {|c-d|}{b-a}>n.$$ Let $g:[0,(b-a)/N]\to [0,e]$ be linear with $g(0)=0$ and $g((b-a)/N)=e.$
For integer $j$ with $0\leq j\leq (N/2)-1$ define $$f(x)=l(x)+g\left((x-a)-\frac {2j(b-a)}{N}\right)$$ when $x-a\in [\frac {2j(b-a)}{N}, \frac {(2j+1)b-a}{N}],$ and define $$f(x)=l(x)+g\left(\frac {(2j+2)(b-a)}{N}-(x-a)\right)$$ when $x-a\in [\frac {(2j+1)(b-a)}{N}, \frac {(2j+2)(b-a)}{N}].$
Observe that when $x\in (a,b)$ and $f'(x)$ exists, we have $$|f'(x)|=|l'(x)\pm g'(x)| =\left|\frac {c-d}{b-a}\pm \frac {e}{(b-a)/N}\right|\geq \frac {e}{(b-a)/N}-\frac {|c-d|}{b-a}>n.$$ 
(III). Any $F\in C[0,1]$ is uniformly  continuous. For $e>0$ take $M\in \mathbb N$ such that $$(1)...\quad \forall x,y\in [0,1]\;(|x-y|\leq 1/M\implies |F(x)-F(y)|\leq e).$$ For integer $i$ with $0\leq i\leq M-1$ use the lemma to take $f_i\in X_n[\frac {i}{M},\frac{i+1}{M}]$ with $f_i(
\frac {i}{M})=F(\frac {i}{M})$ and $f_i(\frac {i+1}{M})=F(\frac {i+1}{M})$ and $$(2)....\quad \min (\;F( i/M), F((i+1)/M)\;)\leq f_i(x)\leq e+\max (\;F(i/M),F( (i+1)/M)\;)$$ for all $x\in [\frac {i}{M},\frac {i+1}{M}].$
For $x\in [i/M,(i+1)/M]$ let $G(x)=f_i(x).$ We have $G\in X_n[0,1]$ and $G$ is continuous. 
Now for any $x\in[0,1]$ take integer $i$ with $0\leq i\leq M-1$ and $x\in [i/M,(i+1)/M].$
For brevity let $\{y,z\}=\{i/M,(i+1)/M\}$ where $F(y)=\min (F(i/M),F(i+1)/M))$ and $F(z)=\max (F(i/M),F(i+1)/M)).$... By (1)  we have $$(3)....\quad -F(z)-e\leq -F(x)\leq -F(y)+e$$   . We have $G(x)=f_i(x)$ so by (2) we have  $$(4)....\quad F(y)\leq G(x)\leq F(z)+e.$$ Adding (3) and (4) we have $$-2e\leq F(y)-F(z)-e \leq G(x)-F(x)\leq F(z)-F(y)+2e\leq 3e .$$ So $|F(x)-G(x)|\leq 3e$ for all $x\in [0,1].$ 
