Suppose that $f :[a,b]\rightarrow \mathbb{R}$ is continuous. Let $\epsilon>0$. Show that there exists a continuous, piecewise linear function $g: [a,b]\rightarrow \mathbb{R}$ such that $|f(x)-g(x)|<\epsilon$ for all $x$ in $[a,b]$.
Proof: Suppose that $f$ is continuous at $p$. Then for every $\epsilon>0$ there exists a $\delta>0$ such that $ |f(x)-f(p)|<3\epsilon $ for all points $x$ in $[a,b]$ for which $|x-p|<\delta$.
let $|g(p)-f(p)|<\epsilon$ for some $\epsilon$, then
$|f(x)-f(p)|= |f(x)-g(x)+g(x)-g(p)+g(p)-f(p)|\leq|f(x)-g(x)|+|g(x)-g(p)|+|g(p)-f(p)|<3\epsilon$
we get $|g(x)-g(p)|<\epsilon$ since $|f(x)-g(x)|<\epsilon$ and $|g(p)-f(p)|<\epsilon$. Hence there exists a continuous, piecewise linear function $g$.