Let $(g_n)_{n\in \mathbb{N}}$ be a compactly convergent sequence of whole functions with $g_n \rightarrow g$. Show that if $g_n(z)$ only have real zeros, $g(z)$ has only real zeros or $g \equiv 0$.
My first thought on this exercise was that since the limit for every sequence of compact convergent holomorphic functions is holomorphic g must be a whole function. I also know that all derivatives of $g_n$ converge compactly $g'_n \rightarrow g'$. At first I thought about taylor expanding but I don't know how to approach this further. Also what is special with real zeros?
A hint would be nice!
Suppose $g$ is not identically 0 and has a zero at a point $c\in \mathbb C \setminus \mathbb R$. Let $r>0$ be such that $B(c,2r)$ does not inresect the real line and such that $g(z) \neq 0$ for $|z-c|=r$. (This is possible because the zeros of $g$ are isolated). Let $\alpha = \inf \{|g(z)|:|z-c|=r\}$. Then $\alpha >0$.For $n$ sufficiently large $|g_n(z)-g(z)|<\alpha$ for any $z\in \overline {B} (c,r)$. Hence $|g_n(z)-g(z)|<|g(z)|$ on the boundary of $B(c,r)$. By Rouche's Theorem $g_n$ and $g$ have the same number of zeros in the disk $B(c,r)$. However, $g_n$ has no zeros there and $g$ has one zero!