TITLE: Inverse image of a closed subscheme
QUESTION [8 upvotes]: Let $f:X\to Y$ be a surjective morphism of schemes, and $Z\subset Y$ a closed subscheme with short exact sequence
$$ 0\to I_Z \to \mathcal{O}_Y \to \mathcal{O}_Z \to 0. $$
What are sufficient conditions on $X$, $Y$, $Z$ and $f$ such that the scheme-theoretic inverse image $W$ of $Z$ is a closed subscheme of $X$ with short exact sequence
$$ 0\to f^*(I_Z) \to \mathcal{O}_X \to \mathcal{O}_W \to 0  \quad? $$

REPLY [7 votes]: Just to amplify Martin's answer, there will be short exact sequence
$$0 \to f^{-1} I_Z \to f^{-1} \mathcal O_Y \to f^{-1} \mathcal O_Z \to 0.$$
(The functor $f^{-1}$ is always exact.)  
Now we tensor with $\mathcal O_Y$ over the natural map $f^{-1}\mathcal O_Y \to \mathcal O_X$ to obtain an exact sequence
$$0 \to Tor^1_{f^{-1}\mathcal O_Y}(\mathcal O_X, f^{-1}\mathcal O_Z) \to f^*I_Z \to \mathcal O_X \to \mathcal O_W \to 0.$$
So in order to get the short exact sequence you ask about, you need the $Tor^1$ term to vanish.
As Martin notes, this holds if $f$ is flat.  More generally, you can think of it as a kind of transversality condition on the map $f$ with respect to the subscheme $Z$.  (For example, if $Y$ is a smooth variety and $X$ and $Z$ are smooth subvarieties intersecting transversally in the usual sense, then this 
Tor term will vanish; here $f$ is just the immersion of $X$ into $Y$.)