Weierstrass approximation theorem - absolute value

I am really struggling on this exercise, and don't even know where to start.

(a) Use the fact that $|a|=\sqrt{a^2}$ to prove that, given $\epsilon>0$, there exists a polynomial $q(x)$ satisfying $||x|-q(x)|<\epsilon$ for all $x$ in $[-1,1]$.

(b) Generalize this conclusion to an arbitrary interval $[a,b]$.

I recognize that this is the conclusion of the Weierstrass approximation theorem. But I don't know how to use it.

• For an explicit construction, find a polynomial $p$ such that $|p(x)-\sqrt x |<\epsilon$ for $x\in [0,1].$ Then for $x\in [-1,1]$ you have $|p(x^2)-|x|\;|=|p(x^2)-\sqrt {x^2}|<\epsilon.$ – DanielWainfleet Feb 26 '17 at 4:09