Let $Y$ be a smooth variety of dimension $n$. Then I can get (a representative for) the canonical divisor class $K_Y$ on $Y$ by taking any rational $n$-form $\omega$ on $Y$ and taking its divisor of zeroes and poles, so $K_Y\equiv div(\omega)$.
Now let $f:X \to Y$ be a birational morphism between smooth varieties of dimension $n$, and $\omega$ an $n$-form on $Y$. Then $f^\ast\omega$ is an n-form on $X$, so by the above recipe (take the divisor of any n-form to get a representative for the canonical divisor class) we get $K_X\equiv div(f^*\omega)$. Also $div(f^*\omega)= f^*div(\omega)$ by definition of pullback of a Cartier divisor. So $K_X\equiv f^*K_Y$ which is not true .. I am missing the exceptional divisor. Where is the flaw in my argument?
This question proves $K_X \equiv f^* K_Y + R$ where $R$ is supported on the exceptional divisor, and it might help to spot where I'm going wrong.