Why is the sum of two algebraic functions algebraic? Let $U\subset\mathbb{C}^n$ be a domain. A holomorphic function $f:U\to \mathbb{C}$ is called $\textbf{algebraic}$ if there exists a polynomial $p(x,y)$ in the variables of $U\times \mathbb{C}$ such that $p(x,f(x))=0$. 
A more geometric interpretation is that the graph $G_f$ of $f$ is an $\textbf{analytic component}$ of an algebraic set $X$. 
My question is: say $f,g$ are two algebraic functions, why is $f+g$ algebraic? It is unclear to me if the roots of $p$ define holomorphic functions, if they define them on all of $U$ etc. 
I also have a more general question. Say $f_1,_2:\mathbb{C}\to \mathbb{C}$ and $g:\mathbb{C}^2\to\mathbb{C}$, all three algebraic. (Also I ask about the case where they are defined on some general domain, I just require them to be composable). Why is $g(f_1,f_2):\mathbb{C}\to\mathbb{C}$ algebraic? Here there is a real issue, that the zariski closure of the graph of $G$ may be bad over some set (say it contains the entire fibre) and $(f_1,f_2)$ may hit this set. So that the graph of the composition is in general $\textbf{NOT}$ an analytic component of $\overline{G_g}\cap (f_1,f_2)(\mathbb{C})\times\mathbb{C}$. However it does seem that the composition is in general algebraic - why? 
Thank you very much! 
 A: Let $F=\Bbb C(x_1,\cdots,x_n)$ be the field of rational functions $U\to \Bbb C$. If $f$ is algebraic on $U$, the relation $p(x,f(x))$ implies that $f(x)$ is algebraic over $F$: we get that it satisfies a monic polynomial in $F[y]$ after dividing $p(x,y)$ by the leading coefficient of $y$. As both $f_1$ and $f_2$ are algebraic, this implies that $F(f_1(x),f_2(x))$ is a finite-dimensional vector space over $F$. As $F(f_1(x)+f_2(x))\subset F(f_1(x),f_2(x))$ is a subspace, it must also be finite dimensional, so $f_1+f_2$ is algebraic over $F$ with minimal polynomial $g(y)$, whose coefficients are rational functions on $U$. After clearing denominators, we recover a polynomial of the form $p'(x,f_1(x)+f_2(x))$, which demonstrates that $f_1+f_2$ is algebraic on $U$.
Your second question has a typo: you want the target of $f_1,f_2$ to be $\Bbb C$, not $\Bbb C^2$. The idea here is similar to the previous paragraph - write $F=\Bbb C(x_1)$, then $f_1,f_2$ are algebraic over $F$, and $g(f_1,f_2)$ is algebraic over $F(f_1,f_2)$ (take the relation $p(x_1,x_2,g(x_1,x_2))$ satisfied by $g$ and plug in for $x_1$ and $x_2$), so the composite extension $F(f_1,f_2,g(f_1,f_2))$ is algebraic over $F$, and thus $g(f_1,f_2)$ satisfies $p(x_1,y)$ via the same construction at the end of the previous paragraph.
As for why we can ignore the "badness" of the closure of the graph, all we need is for our function to satisfy the polynomial relation on a dense set: for then $p(x,f(x))$ is a continuous function which is equal to zero on a dense set and thus zero everywhere by continuity. So "bad fibers" appearing infrequently enough don't invalidate our polynomial relation.
(As an aside, it's interesting to compare these sorts of proofs to the case of semi-algebraic/definable functions: there, the strategy is to use quantifier elimination to write the projection of $(x,f_1(x),f_2(x),f_1(x)+f_2(x))$ in terms of formulas not involving $f_1$ or $f_2$. So somehow algebraicness here is playing the same role that quantifier elimination plays in those theories.)
