For a function $h:[0,1] \to \mathbb{R}$: 
$$h(x) = \begin{cases} 1~~\text{for}~~ x\in[0, \frac12] \\0 ~~\text{for}~~ x\in(\frac12, 1] \end{cases}$$

how could we prove the existence of sequence of polynomials $(p\_n)\_{n=1}^\infty$ such that $\lim\_{n\to\infty} \int\_0^1 |h(x) - p\_n(x)|^2 dx = 0$ holds?

I was thinking of something similar to Weierstrauss approximation theorem but it required $h$ to be continuous function which in our case isn't.