Is blowing down functorial? Let $f: X \to Y$ be a morphism of smooth surfaces and $C \subset Y$ be a contractible exceptional curve on $Y$. Assume that $f^{-1}(C)$ is a contractible exceptional curve as well. Denote by $X'$ (resp. $Y'$) the blow down of $f^{-1}(C)$ (resp. $C$). Does there exist a morphism $g:X' \to Y'$ such that $X$ is the fiber product $Y \times_{Y'} X'$ and the natural morphism from $Y \times_{Y'} X'$ to $Y$ is the same as $f$? Here the morphism from $Y$ to $Y'$ is the natural blow-up morphism.
 A: EDIT: as Artie pointed out I misinterpreted the problem, so I should change the answer... Here it is. In fact, I believe it is much simpler this way actually...

First observe that the assumption that $f^{-1}(C)$ is a contractible exceptional curve on $X$ implies that $f$ has to be dominant. 
If $f$ is not assumed to be proper at least over the points of $C$, then I am not sure what it means that $f^{-1}(C)$ is contractible, so I will assume the OP meant that $f$ is proper.
In that case, since both $X$ and $Y$ are smooth, we may assume that $f$ is projective. Next consider the Stein factorization of $f$ and observe that the intermediate pre-image of $C$ still has to be contractible, because its image via a finite map is contractible, so the Stein factorization of the composition of the contraction of $C$ and the finite map will contract the pre-image. In other words we may replace $Y$ with this finite cover and assume that $f$ is a projective birational morphism. (I am suspecting that the OP may have actually meant to assume this).
Let $T\subset Y$ denote the image of the exceptional set of $f$. Clearly the points in $T\setminus C$ make no difference, so we might as well throw them out. Once we did that, then $f^{-1}(C)$ contains the exceptional locus of $f$ and hence $X'$ is the same as $Y'$, so the fiber product $Y\times_{Y'}X'$ is simply $Y$. 
In other words, (just as I said before), the desired outcome can only happen if the two morphisms are "independent", by which I mean that $f$ is an isomorphism over $C$ (this is after Stein factorization). In that case the two morphisms are obviously interchangeable. 
For some reason I assumed originally the OP meant that the strict transform of $C$ is contractible. In my defense, I should add that if $f$ is proper and dominant, then $f^{-1}(C)$ is automatically contractible: The Stein factorization of the composition $X\to Y\to Y'$ contracts $f^{-1}(C)$.
The example below shows what can go wrong with trying to do this with the strict transform instead of the pre-image.
Let $Y'$ be an arbitrary smooth surface. Blow up a point $P\in Y'$ to get $b:Y\to Y'$. Now blow-up a point on the exceptional divisor $C=b^{-1}(P)\subset Y$  to get $f:X\to Y$. The strict transform $f^{-1}_*(C)\subset X$ is a $(-2)$-curve and hence blows down $X\to X'$ to a rational double point $Q\in X'$ (locally analytically isomorpohic to cone over a quadric curve). The induced rational map $X'\dashrightarrow Y'$ is an isomorphism away from $P$ and $Q$, that is, $X'\setminus \{Q\}\overset\simeq\to Y'\setminus\{P\}$, but there cannot be an extension of this to a morphism $X'\to Y'$, because that would have to be an isomorphism by Zariski's Main Theorem.
