Why doesn't the Weierstrass approximation theorem imply that every continuous function can be written as a power series? I hope that my question in the title is well formulated.
I am a little bit confused with the next exercise from a book:
Argue that there exists functions $f \in C[0, \frac{1}{2}]$ that cannot be written on the form
$$
f(x) = \sum_{k=0}^{\infty}c_kx^k, x\in(0, \frac{1}{2}).
$$
But Weierstrass' theorem states that $||f(x)-P(x)||_{\infty} < \epsilon$, where $P(x)$ is a polynomial for $x\in[a,b]$.
The statement of the exercises refers to an open and bounded interval, and in Weierstrass to a closed and bounded interval for the polynomial. Is this the key? to be honest, I do not see why.
 A: Weierstrass theorem tells that on a compact interval, given a continuous function, there is a sequence of polynomials converging uniformly to this function. But the polynomials are not necessarily of the form $\sum_{j=0}^{N_n}c_jx^j$, because the coefficients depend on $n$. They are indeed of the form $\sum_{k=0}^{N_n}c_{n,k}x^k$.
To get a concrete example, consider $\left|x-\frac 12\right|$. This cannot be written as a power series, because this function would be differentiable at $1/2$.
A: think about $f(x) = \frac 1x$.  
On any closed interval $[a,b]$ with $a>0$ the function is bounded and I can approximate it very well with a polynomial.
But on the open interval $(0,1)$ it's unbounded.  The reason I can get away with this is because it's not defined at $0$.  Any continuous function on a closed interval is bounded.  That's not true on open intervals.
That's why Weierstrass can't help with open intervals. For the answer to the homework problem I'll refer you to Davide Giraudo's answer which has just popped up. (Which is much easier than proving that $\frac 1x$ can't be written as a polynomial.)
