# Can you check my proof on piecewise linear approximations?

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$.

Others have already remarked that your $g$ coming out of nowhere is a somewhat fluffy object. There is one more thing: You can do better than just "proving existence". Think of how you would go about constructing such a $g$ when the graph of $f$ is given to you and then make a proof out of your line of thinking.

Reading your proof, I wonder a few things. Firstly, you say ' let $|g(p) - f(p) | < \epsilon$... does such a $g$ exist? Is it linear? Piecewise linear? Is it even continuous?

These are the problems I have with the proof. But if you update your proof, I'll update this answer.

I'm regret to say that your proof may not be right.Actually, you have not created continuous, piecewise linear function g(x).My suggestion:1.f is uniformly continuous. 2.You can form the step function at first then work out the continuous one