Example where naive equality of rational functions does not give a sheaf Let $f,g\in \Bbbk[x_1,\dots,x_n]$. Usually a ring of rational functions is defined as a localization of the polynomial ring (or of the ring of polynomial functions). In this case, equality of rational functions is a global notion: $\tfrac{f_1}{g_1}=\tfrac{f_2}{g_2}$ means $f_1g_2=f_2g_1$ either as elements in a polynomial ring or as functions on $\Bbbk^n$.
Suppose instead we define $\tfrac{f_1}{g_1}=\tfrac{f_2}{g_2}$ for $f_1,g_1$ coprime and $f_2,g_2$ coprime to mean the associated functions coincide when they're defined, i.e on the intersection of the supports of $g_1,g_2$. In other words if the polynomial functions $f_1g_2,f_2g_1$ are equal on $\mathrm{supp}(g_1)\cap\mathrm{supp}(g_2)$.
What is an example where equality of rational functions holds in this local sense but there is no global (defined on the union of the supports) rational function restricting to $\tfrac{f_1}{g_1},\tfrac{f_2}{g_2}$?
There seems to be no example in $\mathbb R,\mathbb C$ for analytic reasons, but I am not sure what happens over general fields.
 A: This cannot happen. We will deal with the cases that $k$ is finite and infinite separately, because the failures are essentially different.
In the finite case, any function $k^n\to k$ can be represented by a polynomial (Lagrange interpolation is a proof of this, for instance). This implies that we can always find a rational function defined on the union of the supports of $g_1,g_2$ which takes the required values everywhere: simply pick as the numerator the polynomial which has values $f_i/g_i$ where either expression is defined and the value $1$ where neither is defined, and then for the denominator the polynomial which has value $0$ where $g_1$ and $g_2$ vanish and $1$ elsewhere.
In the infinite case, we prove a lemma first.
Lemma: If $F$ is an infinite field, then any polynomial which vanishes identically on $F^n$ is the zero polynomial.
Proof. Start with $n=1$. Then any nonzero polynomial of degree $d$ has at most $d$ distinct roots, and thus cannot vanish identically on an infinite field.
In the case that $n>1$, suppose our polynomial $f\in F[x_1,\cdots,x_n]$ is nonzero. Writing $f\in F(x_1,\cdots,x_{n-1})[x_n]$, we see that there are a finite number of roots of this polynomial in $x_n$. So we can pick a $b_n\in F$ so that $f(x_1,\cdots,x_{n-1},b_n)$ is not    identically zero. Repeating this trick a number of times, we find $b_2,\cdots,b_n$ so that $f(x_1,b_2,\cdots,b_n)$ is nonzero, and then we may apply the $n=1$ case. $\blacksquare$
Now I claim that for $k$ infinite, $k^n$ with the Zariski topology (closed subsets are given by the common vanishing locus of an ideal in $k[x_1,\cdots,x_n]$) is irreducible. Suppose we can write $k^n$ as the union of two distinct proper closed subsets $C_1=V(I_1)$ and $C_2=V(I_2)$. Now for any choice of nonzero polynomials $f_1\in I_1$ and $f_2\in I_2$, we get that $V(f_1)\supset V(I_1)$ and $V(f_2)\supset V(I_2)$, so we have that $V(f_1)\cup V(f_2)=k^n$. But $V(f_1)\cup V(f_2)=V(f_1f_2)$, so $f_1f_2$ vanishses identically and must be zero by the lemma. But $k[x_1,\cdots,x_n]$ is a domain, so $f_1$ or $f_2$ is zero, which is a contradiction.
Next, the vanishing locus of $f_1g_2-f_2g_1$ is a Zariski-closed set which contains the Zariski-open subset where $g_1$ and $g_2$ are simultaneously nonzero. As all open subsets of an irreducible space are dense, this means that $f_1g_2-f_2g_1$ vanishes on all of $k^n$, so by the lemma it is the zero polynomial. This means that we have $f_1g_2=f_2g_1$ as elements of $k[x_1,\cdots,x_n]$. Now, applying the fact that polynomial rings over a field are UFDs, we see that if the pairs $f_1,g_1$ and $f_2,g_2$ are both relatively prime and we have $f_1g_2=f_2g_1$, then $f_1=f_2$ and $g_1=g_2$. So the supports of $g_1,g_2$ are the same and $f_1/g_1$ suffices.

As a final comment, this is kind of a strange question to ask if you're interested in algebraic geometry, because one of the big moneymakers in the field is keeping track of functions more fastidiously than just by their values. We frequently keep track of functions which are different yet evaluate the same everywhere (two functions differing by a nilpotent element, for instance) and this extra care actually helps us prove theorems and make sense of the geometry we're doing.
