I am a bit embarrassed to ask this question, but still: assume that I have
a finite morphism $\pi:X\to Y$ of affine algebraic varieties over a field (probably
finiteness is too strong an assumption, but it is true in my situation, so let
me assume it), which is an isomorphism
over an open subset $U$ of $Y$. Let $Z$ be the complement of $U$. Assume that 
I am given a regular function $f$ on $X$ which vanishes on the scheme-theoretic preimage
$\pi^{-1}(Z)$ of $Z$. Does it come from a function on $Y$?



Extending a polynomial function from an open subset
I don't think so. Let $Y$ be the plane curve $y\_1^2=y\_2^5$, let $X$ be the line with coordinate $x$, and define $\pi:X\to Y$ by $y\_1=x^5,y\_2=x^2$. It's an isomorphism outside the closed point $y\_1=0=y\_2$. The function $x^3$ vanishes on the scheme-theoretic preimage (that is, it belongs to the ideal of $k[x]$ generated by $x^5$ and $x^2$), but it doesn't come from a function on $Y$ (that is, it is not in the subring of $k[x]$ generated by $x^5$ and $x^2$).


