Recall that a point \(x\) is a limit point of a set \(S\) if every punctured neighborhood of \(x\) contains a point of \(S\), and any infinite subset of a compact set contains a limit point.
Suppose \(f\) is holomorphic on a bounded connected domain \(\Omega \neq \emptyset\). TFAE:
 \(f(z) \equiv 0\)
 There is an accumulation point \(z_0\) and a sequence \(\left\{{z_k}\right\}\to z_0\) with \(f(z_k) = 0\) for all \(k\), with the \(z_k\) distinct.
 There is a point \(z_0\) with \(f^{(n)}(z_0) = 0\) for all \(n\).
Two functions agreeing on a set with a limit point are equal on a domain.
\(1\implies 2\): Take \(z_k \coloneqq z_0 + C{1\over k}\) for any \(z_0\in \Omega\), since \(f(z_0) = 0\) for any such \(z_k\). Choose the constant \(C\) such that \(z_k \in \Omega\) for all \(k\).
\(2\implies 3\): Given such a \(z_0\), take a Laurent expansion centered there. Then for some minimal \(m\) with \(c_m \neq 0\), \begin{align*} f(z) = \sum_{k\geq m}c_k (zz_0)^k = (zz_0)^m \sum_{k\geq m}c_k (zz_0)^{km} \coloneqq(zz_0)^m g(z) ,\end{align*} where \(g\) is holomorphic on some neighborhood of \(z_0\) and nonvanishing at \(z_0\), since \(g(z_0) = c_m \neq 0\). By continuity, \(g\) is nonzero on some (potentially smaller) neighborhood \(U \ni z_0\). Since \(0 = f(z_k) = = (z_k  z_0)^m g(z_k)\) for all \(k\) with \(z_k\neq z_0\) and \(z_k\) distinct, this forces infinitely many \(z_k\) to equal \(z_0\), a contradiction. So \(c_m = 0\) for all \(m\), forcing \(f\equiv 0\).
\(3\implies 1\): Pick \(z_0\) with \(f^{(k)}(z_0) = 0\) for all \(k\). Then \(f = \sum_{k\geq 0} c_k (zz_0)^k\) with \(c_k \sim f^{(k)}(z_0)\), so \(c_k = 0\) for all \(k\) and \(f\equiv 0\) on some disc \(D_r(z_0) \subseteq \Omega\). Write \(U \coloneqq\left\{{z_0\in \Omega{~\mathrel{\Big\vert}~}f^{(k)}(z_0) = 0 \text{ for all }k }\right\}\), then \(U\) is open in \(\Omega\). The claim is that \(U\) is also closed in \(\Omega\), and a closed and open subset of a connected set is the entire thing. Consider \(V\coloneqq\Omega\setminus U\). If \(w_0\in V\), there is some \(k\) with \(f^{(k)}(w_0)\neq 0\). Since \(f^{(k)}\) is continuous, it is nonzero on some neighborhood about \(w_0\). So \(w_0\) is an interior point of \(V\), making \(V\) open and \(U\) closed.
If \(f(z)\) and \(g(z)\) are analytic on a domain \(\Omega\), and if \(f(z)=g(z)\) for \(z\) belonging to a set that has a nonisolated point, then \(f(z)=g(z)\) for all \(z \in \Omega\).
More generally, if \(\Omega\) is a domain with a nonisolated point, \(F(z, w): \Omega{ {}^{ \scriptscriptstyle\times^{2} } }\to {\mathbf{C}}\) is holomorphic in both variables, and \(F(z, w) \equiv 0\) on \(\Omega\), then \(F(z, w) \equiv 0\) on any domain \(\Omega' \supseteq\Omega\).
Since \(\sin^2(z)+\cos^2(z) = 1\) for \(z\in {\mathbf{R}}\), which has a limit point, this holds for \(z\in {\mathbf{C}}\) as well. For the generalization, consider \(F(z, w) \coloneqq e^{z+w}e^z e^w\); then \(F\equiv 0\) on \({\mathbf{R}}\) and thus this holds on \({\mathbf{C}}\).
Exercises
Let \(f\) be entire and for every \(a\in {\mathbf{C}}\), and write the Laurent expansion about \(a\) as \(f(z) = \sum_{k\geq 0} c_{k, a} (za)^k\). Suppose that for every \(a\), there exists some \(k\) such that \(c_{k, a} = 0\). Show that \(f\) is a polynomial.

Claim: \(f^{(n)} = 0\) for some \(n\).

Collect all of these bad points up into \(Z_n \coloneqq\left\{{a\in {\mathbf{C}}{~\mathrel{\Big\vert}~}c_{n, a} = 0}\right\}\) and write \(Z = \bigcup_n Z_n\). Note that \(f^{(n)}(z) = 0\) on \(Z_n\).

By hypothesis, \(Z = {\mathbf{C}}\), so not every \(Z_n\) can be countable. Pick any \(Z_n\) which is uncountable.

Write \(Z_n = \bigcup_{m} Z_{m, n}\) where \(Z_{m, n} \coloneqq{\mathbb{D}}_m(0) \cap Z_n\) as a union of increasing discs, then not every \(Z_{m, n}\) can be finite, so pick an infinite one.

Now \(Z_{m, n}\) has a limit point since \({\mathbb{D}}_m(0)\) forms a complete totally bounded metric space, and \(f^{(n)}(z) = 0\) on \(Z_{m, n}\), so by the identity principle \(f^{(n)}(z) = 0\) on \({\mathbf{C}}\).