Confusion about relationship between continuous and real analytic functions

By Weierstraß aprroximation theorem, every continuous function can be $$\epsilon$$-approximated by a polynomial, i.e., if $$f:[a,b]\to\mathbb{R}$$ is a continuous function, then for all $$\epsilon>0$$ there exists a polynomial $$P:[a,b]\to\mathbb{R}$$ such that $$d_{\infty} (P,f) < \epsilon$$ (or using the definition of the metric $$\forall \epsilon>0 \quad \forall x \in [a,b] \quad \exists P: \quad |P(x) - f(x)|<\epsilon$$).

But doesn't this imply that every continuous function can be represented as infinite polynomial, and is thus real analytic. I know that every real analytic function is continuous and even infinitely differentiable, but not the other way around. So where am I assuming somthing which is not true?

No, that's not true. The function $$f$$ being analytic means that around any point $$x_0$$ you can write it as a power series $$f(x)=\sum_{n=0}^\infty a_n(x-x_0)^n$$ which converges for some positive radius. It means here you have the sequence of polynomials $$P_N(x)=\sum_{n=0}^N a_n(x-x_0)^n$$ which converges to $$f$$ at some radius around $$x_0$$. In this sequence the "first" coefficients are preserved, you just add more terms every time. You don't get that result from Weierstrass theorem. All you know if that given a continuous function defined on a compact interval there is a sequence of polynomials which converges to it uniformly. Maybe the coefficients of the different polynomials in the sequence have nothing to do with each other. So you might not able to build a power series from this sequence of polynomials.
The function $$f:(0,1)\to \mathbb{R}$$ defined by, $$f(x)=e^{-\frac{1}{x^2}}$$ is smooth on $$(0,1)$$ but is not real analytic i.e. has no power series expansion. Link: https://en.wikipedia.org/wiki/Non-analytic_smooth_function
Weierstrass says that given a continuous $$f$$ on $$[a,b],$$ there is a sequence $$p_n$$ of polynomials such that $$p_n\to f$$ uniformly on $$[a,b].$$ It follows from this that
$$\tag 1 f(x) = p_1(x)+ \sum_{n=2}^{\infty} (p_n(x)-p_{n-1}(x)),$$
the series converging uniformly on $$[a,b].$$ In this sense $$f$$ is an infinite series of polynomials. As pointed out by others, this does not imply $$f$$ has a power series representation.