Suppose that $A(z)$ and $B(z)$ are both analytic function defined on a region that happens to be the same size and shape as California. Suppose, further, that $A$ and $B$ both happen to have the same effect on a tiny piece of curve, say a fallen eyelash lying in San Francisco street. This tiny measure of agreement instantly forces them into total agreement, even hundreds of miles away in Los Angeles! For $(A-B)$ is analytic throughout California, and since it crushes the eyelash to $0$, it must do the same to the entire state.
Tristan Needham Visual Complex Analysis page-250
This idea in the above paragraph sounds somewhat too good to be true. Is there any formal theorem corresponding to the above?
Yes: the Identity Theorem, which states that if $G$ is an open connected subset of $\Bbb C$, if $C\subset G$ has at least an accumulation point in $G$, and if $f,g\colon G\longrightarrow\Bbb C$ are analytic functions such that $f|_C=g|_C$, then $f=g$.