The Weierstrass approximation theorem says that all continuous functions on $[0,1]$ can be approximated uniformly by polynomials.
Trying to facilitate the digestion of the fatty Christmas food, I was browsing through some complex analysis material, and I found that there is another theorem that states that for any infinite sequence of holomorphic functions that converges uniformly to a function $f$, the resulting function $f$ is holomorphic.
I am having trouble combining the two. All polynomials are entire, so a sequence of polynomials converges to a holomorphic function. However, by Weierstrass, a sequence of real polynomials, which can be seen as restrictions of their complex counterparts, can converge to a non real-differential function, such as $f(x)=|x|$. But I fail to see how a holomorphic function can behave as $|x|$ on the real line.
What am I missing here?
As Andres Caicedo and Daniel Fischer already said: the theorem about preservation of holomorphicity under uniform convergence concerns open subsets of the plane, which an interval is not. If one approximates $|x|$ on $[-1,1]$ uniformly by polynomials $p_n$, the sequence $(p_n)$ will not be uniformly convergent in any open set containing $0$.
Just for completeness, a direct proof of the latter claim. For every $h>0$ we have $$ \frac{p_n(h)-2p_n(0)+p_n(-h)}{h^2}\to \frac{|h|-0+|-h|}{h^2}=\frac{2}{h} $$ On the other hand, the mean value theorem implies that $p_n(h)-p_n(0)=hp'(t_1)$ and $p_n(-h)-p_n(0)=-hp'(t_2)$ for some $t_1,t_2\in [-h,h]$. Another application of the mean value theorem gives $$ \frac{p_n(h)-2p_n(0)+p_n(-h)}{h^2} = p_n''(t) $$ for some $t\in[-h,h]$. Since $h$ can be arbitrarily small, the sequence $p_n''$ is not uniformly bounded in any neighborhood of $0$ in $\mathbb R$. In view of the Cauchy estimates, this implies $p_n $ is not uniformly bounded in any neighborhood of $0$ in $\mathbb C$.