TITLE: Counterexample to the set of all algebraic polynomials being dense in $[0,1]$
QUESTION [5 upvotes]: Today in class the professor said that if we consider $X = [0, 1]$ to be equipped with the Lebesgue measure, then  the set of all algebraic polynomials is not dense in $L^\infty([0, 1])$. But I couldn't come up with a counterexample to convince myself. 
Could someone come up with one?

REPLY [5 votes]: Polynomials are continuous. It is a theorem in real analysis that the uniform limit of continuous functions is continuous. As a consequence, the closure in the $\sup$-norm of the algebra of polynomials is contained in the set of continuous functions. 
Therefore, any bounded function $f$ that is not continuous should convince you that $f$ is not the uniform limit of polynomials.