Suppose $f$ and $g$ are holomorphic on an open connected set $S$.
If $D=\{z\in S:(f(z))^n=(g(z))^n\}$ has a limit point in $S$ for $n\in \mathbb{N}$, show there exists a constant $k$ with $k^n=1$, such that $f(z)=kg(z)$
This looks very similar to the identity theorem. I know since $D$ has a limit point in $S$, then by the Identity Theorem, $(f(z))^n=(g(z))^n$. I am not sure where to go from here.
Maybe the factorization $$(f(z))^n-(g(z))^n=$$
$$(f(z)-g(z))((f(z)^{n-1})+(f(z))^{n-2}g(z)+\cdots+f(z)(g(z))^{n-2}+(g(z))^{n-1})=0$$ may help?
I think I am overthinking this, and not really sure where to go from here. Any help would be much appreciated.
If $g$ is the null function, then $f$ is the null function too.
Otherwise, let $Z$ be the set of zeros of $g$. Notice that if $Z$ had an accumulation point then, by the identity theorem, $g$ would be the null function. So, $Z$ is a closed discrete subset of $S$. This implies that $S\setminus Z$ is also an open connected set.
Consider the function$$\begin{array}{rccc}h\colon&S\setminus Z&\longrightarrow&\mathbb C\\&z&\mapsto&\dfrac{f(z)}{g(z)}.\end{array}$$Since $S\setminus Z$ is an open connected set $h(S\setminus Z)$ is a connected set too. But, since $h^n(z)=1$ for each $z\in S\setminus Z$, $h(S\setminus Z)\subset\{n^{\text{th}}\text{ roots of }1\}$. But this is a finite set, and so its only connected subsets are the singletons. So, $h=k$ for some number $k$ such that $k^n=1$. But this means thath $f=kg$.