Let $f:\mathbb R \rightarrow\mathbb R $ be continuous, and choose $-\infty < a 0$. Show there exists a polynomial $p$ such that:
a) $p(a)=f(a),\; p(b)=f(b)$
b) $|f(t)-p(t)|<\epsilon$ for all $t\in [a,b]$
The second part is just Weierstrass approximation theorem. But the first part I didn't manage to get. I tried conjuring up a polynomial in the form $$p=p_\epsilon+(\frac{a-x}{a-b})^Nf(b)+(\frac{b-x}{b-a})^Nf(a)$$ such that $p_\epsilon$ satisfies b by the theorem, and then play with constants to set bounds on the maximal error that the extra terms introduce (and also to cancel out $p_\epsilon$ at the bounds). I don't think this can work, since it eventually means that the extra terms are expected to approximate "some portion" of $f$, but given the fact that the proof to Weiersttrass' theorem is pretty complicated, I guess this isn't the way to go... How should I approach this properly? Thanks