Let $M$ be a complex $2$-dimensional manifold and $C$ be a compact complex curve in $M$ (possibly singular). Let us suppose that there exists a holomorphic function $f\in\mathcal{O}(M)$ such that
- $f$ is non constant
- $\{f=0\}=C\cup A$, with $A$ a complex analytic set of dimension $1$
- there is no neighborhood $V$ of $C$ and no function $g\in\mathcal{O}(V)$ such that $C=\{g=0\}$.
I would like to conclude that $C\cdot C<0$.
If $C$ is smooth, then $f$ gives me a nontrivial section of the conormal bundle: let $\{F_j\}$ be local equations for $C$, then $\{f/F_j\}_j$ gives a section of $[-C]\vert_C=N^*_{C,M}$ (the conormal bundle of $C$ in $M$), hence $\deg N_{C,M}<0$, therefore $C\cdot C<0$.
What if $C$ is singular?
NOTE: I posted the same question on MathOverflow (https://mathoverflow.net/questions/139686/negative-self-intersection-and-section-of-the-conormal-sheaf-for-a-singular-comp).