Preserving canonical divisors under a morphism of schemes Let $f: X \rightarrow Y$ be a morphism of schemes and let $\omega_{X}$ and $\omega_{Y}$ be theirs canonical divisors. When do we have $f_{\ast} \omega_{X} \cong \omega_{Y}$ and $f^{\ast} \omega_{Y} \cong \omega_{X}$? Is this true when $f$ is the blowing up of a nonsingular variety $Y$ whith respect to a nonsingular subvariety $Z$ of codimension $r \geq 2$?
Thanks.
 A: Here is some intuition behind the question you are asking:
Let's restrict to the case of a morphism $f: X \to Y$ of smooth varieties
over a field $k$, of the same dimension, say $n$.  Then there is natural morphism
$f^* \omega_Y \to \omega_X$, which is given by "pulling back differential $n$-forms".  If you haven't thought this through, you should.
If $f$ is not dominant, say it factors through a lower-dimensional closed 
subvariety $Z$ of $Y$, then pull-back of $n$-forms along $f$ will factor through the restriction of $n$-forms from $Y$ to $Z$, and this latter operation is identically zero (since $Z$ has dimension $< n$ by assumption, and so any $n$-form on $Z$ vanishes).
So suppose that $f$ is dominant, and let's suppose that $f$ is separated too
(i.e. that the induced extension of function fields $K(Y) \subset K(X)$ is
separable; this is automatic in char. zero, and rules examples like $f$ being
the Frobenius map in char. $p$).
Then $f^* \omega_Y \to \omega_X$ will be injective, but it need not be an
isomorphism.  The reason for this, roughly speaking, is that if the map $f$ has any kind of ramification,
then the pullback of a (locally defined) differential form on $Y$ will  automatically be forced
to vanish at any points in the ramification locus on $X$ contained within 
the preimage of its domain, whereas a random differential form (locally defined) on $X$ won't be forced to so vanish. 
You should consider first the case of curves.  Think about the basic example
of a ramified map $t \mapsto t^n$.  Then $f(t)dt$ on the target pulls back to
$f(t^n)d(t^n) = n t^{n-1} f(t^n)dt$ on the source, and so necessarily vanishes to order at least $n-1$ at the point $t = 0$ on the source.   
If you look in the discussion of the Riemann--Hurwitz formula for curves
in Hartshorne, you will see an elaboration on this example, leading to a proof
of the Riemann--Hurwitz formula.
Another example is the map $\mathbb A^2 \to \mathbb A^2$ given by $(x,y) \mapsto (xy ,y)$.  A differential form $f(x,y)dx\wedge dy$ on the target pulls back
to $f(xy,y)y dx \wedge dy$ on the source, and so necessarily vanishes along 
the curve $y = 0$.   
This second example is closely  related to QiL's suggestion above of considering
the blow-up of $\mathbb A^2$ at the origin.  Do you see how?
