(Proof verification) $\pi: X\to Y$ birational with $X$ smooth implies $\pi_*O_X=O_Y$. As the title suggests, I am looking for a confirmation or falsification of my proof of the following 

Let $\pi: X\to Y$ be a birational map of algebraic varieties over the complex numbers with $X$ smooth. Then, $\pi_XO_X=O_Y$.

My idea goes as follows.
Since $X$ and $Y$ are birational, there exists open subsets $U\subset X$ and $V\subset Y$ such that $\pi: U\to V$ is an isomorphism. In particular, $O_X(U)=(\pi_*O_X)(V)=O_Y(V)$. What we have to show is that $$\pi^*: O_Y\to \pi_*O_X,\ f\mapsto \pi^*f:=f\circ \pi$$ is surjective (since its obviously injective and a morphism). Thus take any $g\in O_X(X)$, that is, a holomorphic map $X\to \mathbb C$. Since $O_X(U)=O_Y(V)$, $$g\mid_U=(\pi^*f)\mid_U$$ for some $f\in O_Y(Y)$. But we are then given two holomorphic functions $g,\pi^*f$ that coincide on an open subset of a complex manifold (since we assumed $X$ to be smooth) and the identity principle then yields that $g=\pi^*f$ and $\pi^*$ is surjective.

I was unable to find any issue with the proof. However, I also have Zariski's Main Theorem in mind, stating that for a birational map $\pi: X\to Y$ of algebraic varieties one needs normality of $Y$ to deduce $\pi_*O_X=O_Y$, which is a condition on the target, whereas the proof given above seems imposes a condition only on the domain. However, ZMT is more general for varieties over other fields and none of $X,Y$ is required to be smooth.
Comments on this are very welcome! If you find any (even small) issue with the proof, please drop a comment. Thanks!
 A: This proof is not true, and the following counterexample is good to keep in mind:
Let $X$ be two copies of $\Bbb A^1$ and let $Y$ be $V(xy)\subset \Bbb A^2$, with the map $f$ acting as $t\mapsto (0,t)$ and $u\mapsto (u,0)$ where $t,u$ are coordinates on the different copies of $\Bbb A^1$. Then certainly removing the origins of both lines in $X$ and the crossing point in $Y$ gives an isomorphism, so this is a birational map. But one can see immediately that the stalk of $f_*\mathcal{O}_X$ is rank 2 at the crossing point of $Y$. 
To get at the particular point where your proof breaks, consider the map $g:X\to \Bbb A^1$,  the map taking the value $1$ on one line and $0$ on the other. Following your procedure, you obtain a function $f$ on $Y$ without the crossing point which is $0$ on one axis and $1$ on the other - this cannot be extended to a function on the whole variety. So your claim here is false.
The essential difficulty here is that sections of a line bundle on a normal variety can be extended over a codimension two set, but not necessarily a codimension one set. For your claim to be true, you'll need to enforce exactly the conditions of Zariski's Main Theorem.
I should also mention that the question of$X$ is smooth and $f:X\to Y$ is birational implying $f_*\mathcal{O}_X \cong \mathcal{O}_Y$ is awfully close to the condition of rational singularities. If you end up studying more algebraic geometry, this class is a particularly well-behaved bunch of singularities.
