Show that $C[a,b]$ is separable with supremum norm by showing countable and dense subset of piecewise linear functions.
Since I cannot use Stone-Weierstrass, I have been struggling with construction and approximation error.
For any given function $f \in C[a,b]$ and for fixed $\epsilon>0$ I have to construct piecewise linear function $p(x)$ s.t. $\sup_{x\in[a,b]}|f(x)-p(x)| < \epsilon$.
Now I have two important questions. How do we construct such piecewise linear function? And moreover, how do we find that the error is lower than epsilon?
Is it somehow connected with the fact that $f$ is also uniformly continuous?
It has a lot to do with uniform continuity.
Take $\varepsilon>0$. There is a $\delta>0$ such that$$\bigl(\forall x,y\in[0,1]\bigr):|x-y|<\delta\implies\bigl|f(x)-f(y)\bigr|<\frac\varepsilon3.$$Pick rational numbers $a_0=0,a_1,a_2,\ldots,a_n=1$ with $a_0<a_1<\cdots<a_n$ and that$$\bigl(\forall i\in\{1,2,\ldots,n\}\bigr):a_u-a_{i-1}<\delta.$$For each $i\in\{1,2,\ldots,n\}$, let $b_i\in\mathbb Q$ be such that $\bigl|b_i-f(a_i)\bigr|<\frac\varepsilon3$. Let $g$ be the piecewise linear function which is linear on each interval $[a_{i-1},a_i]$ and such that $g(a_i)=b_i$ for each $i\in\{0,1,\ldots,n\}$. Then $(\forall x\in[0,1]):\bigl|f(x)-g(x)\bigr|<\varepsilon$. FInally, the set of all such piecewise linear functions $g$ is countable.