In this problem, consider $K$ an algebraic closed field and $X\subset\mathbb{A}^n_k$ an irreducible variety. Given an open Zariski $U\subset X$, we say that a function $\phi:U\rightarrow K$ is regular if $\phi = f/g$ for some $f,g\in K[x_1,\ldots, x_n]$ (in this case, $g$ is never zero in $U$).
Now, the problem: fix $p\in X$, consider two open Zariski $U,V$ containing $p$ and two regular functions $\phi:U\rightarrow K$, $\psi:V\rightarrow K$. We can define a relation $(\phi, U)\sim (\psi,V)$ when there is an open Zariski $W\subset U\cap V$ such that $\phi=\psi$ in $W$. I want to prove that this relation is an equivalence relation.
It's not hard to prove reflexivity and symmetry, but the transitivity is hard. Suppose $(\phi, U)\sim (\psi,V)$ and $\varphi:T\rightarrow K$ such that $(\psi, V)\sim (\varphi,T)$. I know there is some open Zariski $Z\subset V\cap T$ such that $\psi = \varphi$ in $Z$. Also I know that $p$ is inside $U,V,T$, but this doesn't guarantees that $U$ and $T$ have non empty intersection. Even if the intersection is non empty, I can't see why would exist an open Zariski inside $U\cap T$, so I'm stuck here.
If is not to ask too much, I have another question. Why can't I just take $W=U\cap V$ when defining this relation?
Thanks.
To begin with, I think you want the definition to be a little more local: you want $\phi$ to be described in a neighborhood of each point $P \in U$ by a ratio of polynomials, but you may not be able to describe $\phi$ on all of $U$ by a single formula like this. The classic example is to look at the cone $xy - zw$ in $\mathbb{A}^4$ over the smooth quadric surface. The expressions $z/y$ and $x/w$ define functions where $y$ and $w$ don't vanish, respectively; and they agree on the overlap. Try to write a single expression for this function!
Anyway, what saves you here is that you are working in an irreducible topological space, and in such a space any two non-empty open subsets have to intersect. Other useful facts: any non-empty open subset of an irreducible space is dense and also irreducible.
Your suspicion at the end is correct: in more general contexts you really need this $W$, but here $W = U \cap V$ is enough. This is because any regular function on a variety is continuous and in particular its zero set is closed. Here the zero set of the function $\phi - \psi$ on $U \cap V$ is a (relatively) closed set containing the dense open subset $W$.