I was trying to prove the claim 'If $f$ is an analytic on a domain $D$ and $|f(z)|=|\sin z|$ for all $z \in D$, then $f(z)=c \sin z,~z \in D$ for some $c\in \mathbb C$'.
It is clear that $g(z)=\frac{f(z)}{\sin z}$ can be analytically extended through out $D$ since $g$ has only removable singularities. However, I couldn't apply Liouville's theorem to state $$g(z)=c,$$(for some complex constant $c$) as $D$ been just a domain. How to justify it?