Let $X$ be a smooth, projective variety and $Y \subset X$ a smooth, effective divisor. Consider now the natural map $i^\ast:H^2(X) \to H^2(Y)$. Then,


1. When is the image of $c\_1(\mathcal{O}\_X(Y)) \in H^2(X)$ under the map $i^\*$ non-zero?
2. If $Z$ is another smooth projective variety containing $Y$ as an effective divisor (meaning $\dim Z=\dim Y+1$), is $j^\*(c\_1(\mathcal{O}\_Z(Y)))=i^\*(c\_1(\mathcal{O}\_X(Y)))$ where $j^\*:H^2(Z) \to H^2(Y)$ is the natural pull-back map?
3. If ($2$) is not true in general, is it true if $Z$ is a deformation of $X$?


Any reference/idea regarding the questions will be most welcome.



Self-intersection of divisors and Chern class
1. Because homological equivalence and numerical equivalence coincide for divisors (up to torsion), we see that $i^\*(c\_1(\mathcal O\_X(Y))) = 0 \in H^2(Y,\mathbb Q)$ if and only if
$$\int\_Y i^\*c\_1(\mathcal O\_X(Y)) \cup \operatorname{cl}\_Y(C) = 0$$
for every curve $C \subseteq Y$ (where $\operatorname{cl}\_Y(C)$ means the cycle class of $C$ as subvariety of $Y$). By the definition of $\operatorname{cl}\_Y(C)$, this means that
$$\int\_C c\_1(\mathcal O\_X(Y)|\_C) = 0,$$
i.e. $Y \cdot C = 0$ for every curve $C \subseteq Y$ (the intersection product now taking place in $X$).


For example, if $Y$ is ample, then $Y \cdot C > 0$ for all $C \subseteq Y$, so $i^\*(c\_1(\mathcal O\_X(Y)))$ is never $0$. Another example is the case $\dim X = 2$ (and $Y$ is irreducible), where the criterion simplifies to $Y^2 = 0$ (because $C = Y$ is the only curve in $Y$).


(The above analysis assumes $\dim X \geq 2$, for otherwise there are no curves in $Y$. The case $\dim X \leq 1$ is easy to deal with.)


The analysis becomes a lot more subtle if one insists to work integrally.
2. This was already shown to be false in the comments.
3. It should be true if the pair $(Z,Y)$ is a deformation of $(X,Y)$ (try to write down a good definition of this; perhaps you want to fix $Y$ along the way). Slogan: 'discrete data does not change in continuous families'. (Of course this is not a proof.)


An outline of a proof could be as follows (but there might be other strategies): a smooth proper family $\mathscr X \to S$ induces isomorphisms of the cohomology of the fibres:
$$H^\*(\mathscr X\_s) \cong H^\*(\mathscr X\_t)$$
for $s,t \in S$. Similarly, if $\mathscr X \to S$ is a smooth proper family together with a closed subscheme $\mathscr Y \subseteq \mathscr X$ that is smooth over $S$ such that each fibre is a divisor, we get a commutative diagram
$$\begin{array}{ccc} H^\*(\mathscr X\_s) & \stackrel\sim\to & H^\*(\mathscr X\_t) \\ \downarrow & & \downarrow \\ H^\*(\mathscr Y\_s) & \stackrel\sim\to &\ H^\*(\mathscr Y\_t). \end{array}\label{1}\tag{1}$$
Then check that under these identifications, $c\_1(\mathcal O\_{\mathscr X\_s}(\mathscr Y\_s)) \in H^2(\mathscr X\_s)$ corresponds to $c\_1(\mathcal O\_{\mathscr X\_t}(\mathscr Y\_t)) \in H^2(\mathscr X\_t)$, hence by commutativity of the diagram the same goes for their pullbacks to $H^2(\mathscr Y\_s)$ and $H^2(\mathscr Y\_t)$. You are in the special case where $\mathscr Y\_s = \mathscr Y\_t$, and you probably need to assume that $\mathscr Y$ is the trivial family $Y \times S$ to make sure that the isomorphism
$$H^\*(\mathscr Y\_s) \stackrel\sim\to H^\*(\mathscr Y\_t)$$
of (\ref{1}) is the identity (as opposed to some other automorphism).


