Is this regular function globally rational? Let $\mathbb{k}$ be an algebraically closed field of characteristic not 2 or 3, and let $X \subseteq \mathbb{A}^2_\mathbb{k}$ be the locally closed subset given by

$X = \{ (x,y) : x^3=y^2, (x,y) \neq (1,-1) \}$.

Consider the function

$f \colon X \to \mathbb{k}$ with $f(x,y) = \frac{1-y}{1-x}$ for $x \neq 1$, and $f(1,1) = \frac{3}{2}$.

$f$ is easily seen to be a regular function of $X$ (aka a morphism $X \to \mathbb{A}^1_\mathbb{k}$ of varieties), since it can be written as $f(x,y) = \frac{1+x+x^2}{1+y}$ for $y \neq -1$. However, I guess that $f$ cannot be represented by a single rational function on $X$.
Can anyone give me a hint how to prove this (if I am not mistaken)? I would also be happy to see more simple examples of this phenomenon.
 A: Suppose for simplicity that ${\rm char}(k)=0.$ Suppose for contradiction that we have $f(x,y)=P(x,y)/Q(x,y)$ where $Q(x,y)$ does not vanish on
$X.$ Thus we have
$$
f(t^2,t^3)=(1-t^3)/(1-t^2)=(1+t+t^2)/(1+t)=P(t^2,t^3)/Q(t^2,t^3)
$$
for all $t\not=-1,1$ and $P(1,1)/Q(1,1)=3/2$. In particular $Q(t^2,t^3)\not=0$ for all $t\not=-1$.
Hence we must have $Q(t^2,t^3)=c(1+t)^n$ for some $c\not=0$ and some $n\geqslant 0$.
However, since the $t$-coefficient of $Q(t^2,t^3)$ vanishes by construction and the $t$-coefficient of
$c(1+t)^n$ does not vanish for any $n\geqslant 1$, we see that $n=0$.
So $Q(t^2,t^3)=c$. Now since the above equalities are true for infinitely many $t$, we have the polynomial
identity
$$
(1+t)P(t^2,t^3)=c(1+t+t^2)
$$
but this is impossible because $1+t$ does not divide $1+t+t^2$.
A: I was previously confused about what it means to write a regular function as a single expression, but I think I have a clearer picture now. I still think the issue is that the closed subscheme $p = (1,-1) \in \text{Spec}\,\mathbb{k}[x,y]/(y^2 - x^3)$ is not "cut out by one equation." However, I think the correct way to translate the (vague) quoted phrase into a rigorous statement is to say that the associated divisor $m \cdot [p]$ on the curve is not principal for any positive integer $m$ -- it is not the divisor of zeros of some regular function on the curve.
Let's start by considering an example where the closed subscheme we cut out is actually a principal divisor. Consider excising the closed subscheme $y = -1$ from the cuspidal cubic curve. Then the divisor corresponding to $y = -1$ is principal: it is given by formally summing the three zeros of the function $y+1$ on the curve (one can write this divisor as $[\omega] + [\omega^2] + [1]$, where $\omega$ is a primitive third root of unity). Once we've removed all three of these points, the function $\frac{1+x+x^2}{1+y}$ is defined everywhere on the curve. And moreover, it is fairly easy to see that any rational function on this open subscheme can be written in terms of a single expression, because the ring of regular functions is $(\mathbb{k}[x,y]/(y^2 - x^3))_{y+1}$.
However, I claim that the divisor $m \cdot [p] = m \cdot [(1,-1)]$ is not principal for any positive integer $m$. Indeed, if it were, then there would be a polynomial $f(x,y) \in \mathbb{k}[x,y]/(y^2 - x^3)$ whose vanishing locus would intersect the cuspidal cubic curve at $p$ with multiplicity $m$, and there is no such $f$.
