Proof composition of analytic functions is analytic Title says it all I looked for a proof on this site but couldn't find one.

Prove if $f$ is analytic on $D$ and $g$ is analytic on $\Omega$ containing the range of $f$ show $g(f(z))$ is analytic.

The statement seems obvious but I can't seem to be able to prove it.
 A: This is really a pointwise result; we don't need analyticity in full open sets.
Suppose $f'(a),g'(f(a))$ both exist. Then $(g\circ f)'(a) = g'(f(a))f'(a).$
Proof: First, $f$ is continuous at $a$ since $f'(a)$ exists. Second, there exists $r>0$ and $M$ such that
$$|g(w)-g(f(a))| \le M|w-f(a)|, w \in D(f(a),r).$$
Suppose $f'(a) = 0.$ Because $f$ is continuous at $a,$ $f(z) \in D(f(a),r)$ for $z$ near $a.$ For such $z,z\ne a,$ we have 
$$\left| \frac{g(f(z)) - g(f(a))}{z-a}\right| \le M\left| \frac{f(z)-f(a)|}{z-a}\right|.$$
The right side $\to 0$ and we see the desired result holds.
If $f'(a)\ne 0,$ then $f(z) \ne f(a)$ for $z$ in some punctured disc centered at $a.$ This allows for the "fake proof" to actually work: For such $z,$
$$\frac{g(f(z)) - g(f(a))}{z-a}= \frac{g(f(z)) - g(f(a))}{f(z)-f(a)}\cdot \frac{f(z)-f(a)}{z-a}.$$
Now let $z\to a$ to bring it on home.
A: Notice that
$$\displaystyle\lim_{z\to z_0}\dfrac{gf(z)-gf(z_0)}{z-z_0} =\displaystyle\lim_{z\to z_0} \left[\dfrac{gf(z)-gf(z_0)}{z-z_0} \times\dfrac{f(z)-f(z_0)}{f(z)-f(z_0)}\right] $$
Where $z_0\in D$
A: A question linking to this question was closed as duplicate when the asker wanted to use the cauchy riemann equations. I will include a proof now showing that functions which obey the cauchy riemann equations are closed under composition.
So suppose we have two functions $f,g :  \mathbb{R}^2 \rightarrow \mathbb{R}^2$ Which we can described explicitly in terms of their "x" and "y" parts as:
$$ f = \left( f_u(x,y), f_v(x,y) \right) $$
$$ g = \left( g_u(x,y), g_v(x,y) \right) $$
The cauchy rieman equations for any such 2 variable to 2 ouput function as $u(x,y)$ and $v(x,y)$ is
$$ \frac{\partial u}{\partial x} = \frac{\partial v}{\partial y} \\ \frac{\partial u}{\partial y} = - \frac{\partial v}{\partial x}$$
So now we want to verify that $ h = g \circ f$ obeys the cauchy riemann equations IF $f$ and $g$ both obey the equations. For convenience we will break up $h$ into two parts $h_u, h_v$ such that
$$ h_u = g_u(f_u(x,y), f_v(x,y)) $$
$$ h_v = g_v(f_u(x,y), f_v(x,y)) $$
So our goal is to show that
$$ \frac{\partial h_u}{\partial x} = \frac{\partial h_v}{\partial y} \\ \frac{\partial h_u}{\partial y} = - \frac{\partial h_v}{\partial x}$$
So now we get ready to pull out that rusty chain rule and get to work. Let's start with the first part of the Cauchy Riemann Equations
$$ \frac{\partial h_u}{\partial x} = \frac{\partial}{\partial x} \left[ g_u(f_u(x,y), f_v(x,y)) \right] = \frac{\partial g_u}{\partial f_u} \frac{\partial f_u}{\partial x} + \frac{\partial g_u}{\partial f_v} \frac{\partial f_v}{\partial x}  $$
$$ \frac{\partial h_v}{\partial y} = \frac{\partial}{\partial x} \left[ g_v(f_u(x,y), f_v(x,y)) \right] = \frac{\partial g_v}{\partial f_u} \frac{\partial f_u}{\partial y} + \frac{\partial g_v}{\partial f_v} \frac{\partial f_v}{\partial y}  $$
Since $f,g$ both the cauchy riemann equations it must be that
$$ \frac{\partial g_u}{\partial f_u} = \frac{\partial g_v}{\partial f_v}$$
and
$$ \frac{\partial f_u}{\partial x} = \frac{\partial f_v}{\partial y} $$
So then we conclude that these two parts are equal:
$$ 
\color{red}{\frac{\partial g_u}{\partial f_u} \frac{\partial f_u}{\partial x}} + \frac{\partial g_u}{\partial f_v} \frac{\partial f_v}{\partial x} \\ 
\frac{\partial g_v}{\partial f_u} \frac{\partial f_u}{\partial y} + \color{red}{\frac{\partial g_v}{\partial f_v} \frac{\partial f_v}{\partial y}}$$
Now the other diagonal is a bit more complicated since
$$ \frac{\partial g_u}{\partial f_v} = -\frac{\partial g_v}{\partial f_u} \\ \frac{\partial f_u}{\partial y} = - \frac{\partial f_v}{\partial x}$$
But when you put those TWO facts together both the minus signs end up cancelling out.
So we have after all this work shown that $h = f \circ g$ obeys ONE of the cauchy riemann equations. The second equation is left as an exercise to the reader ;)
