Set of square integrable functions as infinite dimensional linear vector spaces I'm new to mathematical physics, and I just recently learnt that the space of all square integrable functions (L2) forms an infinite dimensional linear vector space.
Consider the set of polynomials $a_0 + a_1x + a_2x^2 + \cdots + a_nx^n$ (of degree utmost $n+1$), which form an n-dimensional linear vector space. I can interpret this as a linear combination of basis vectors 1, $x$, $x^2$ and so on, with coefficients $a_0$, $a_1$, $a_2$ and so on respectively. 
If I were to extend the same understanding to an infinite dimensional linear vector space, I could interpret that functions with a Taylor series expansion that converge to the function are part of the vector space, with the basis being 1, $x$, $x^2$ and so on, with their coefficients being $f(0)$, $f'(0)$, ${f''(0)}^2/2!$ and so on. 
Does this mean that all square integrable functions have a Taylor series associated with them that converges to the function? Can someone throw some light on this? Also, if my understanding of anything that I've mentioned above is not correct, please correct me. Thanks. 
 A: First of all, it is not the case that the Taylor series of a function necessarily converges to the function, even if all derivatives at the point are defined.  One classic example of this is the function
$$
f(x) = \begin{cases}
e^{-1/x^2} & x \neq 0\\
0 & x=0
\end{cases}.
$$
Though it might not be obvious that this is the case, it turns out that this $f(x)$ has infinitely many derivatives defined at $x = 0$.  In fact, we have $f^{(k)}(0) = 0$ for every $k$.  Thus, the $k$th Taylor polynomial centered at $0$ is given by $T_k(x) = 0$, and is clear that the series of functions $T_k$ fails to converge to $f$ in any reasonable sense.
You might find it interesting that the function $g(x) = e^{-x^2}f(x)$ exhibits similar behavior at $x = 0$ and is also square-integrable over $\Bbb R$.
A weaker version of your statement does hold: if we consider $L_2([a,b])$, the set of square integrable functions $f:[a,b] \to \Bbb C$, then for any $f \in L_2$ there exists a sequence of polynomials $p_n(x)$ such that $p_n \to f$ relative to the $L_2$ norm.  That is, there exists a sequence of polynomials $p_n$ such that the integral $\int_a^b |p_n(x) - f(x)|^2 dx$ converges to zero as $n \to \infty$. This can be proven as a consequence of the Weierstrass approximation theorem.  In other words, we might say that the subspace of polynomials in $L_2([a,b])$ is dense.
Note that $L_2(\Bbb R)$, the set of square integrable functions $f:\Bbb R \to \Bbb C$, fails to contain any non-zero functions of the form $a_0 + a_1 x + \cdots + a_n x^n$, so I would argue that it no longer makes sense to approximate $f(x)$ with polynomials in this context.  That being said, results regarding the approximation of functions $f \in L_2(\Bbb R)$ exists and are of vital importance in harmonic analysis.
