Hartshorne Ex. 1.3.8 - Where do I take intersections here?

I will try to make clear what is a regular and rational function, which is a good exercise for me because I am also learning this stuff.

Let $X$ be an irreducible affine, quasi-affine, projective or quasi-projective variety. We know what a regular function on $X$ is (cf. Hartshorne p.15) and I won't recall it here. Denote by $\mathcal{O}(X)$ the set of regular functions on $X$.

Now a rational function on $X$ is : the data of an open $U\subset X$ and a regular function $\phi : U \rightarrow K$ modulo the obvious equivalent relation (cf. Hatrshorne p.16). Denote by $K(X)$ this set.

Now there is an obvious morphism of $K$-algebras $\mathcal{O}(X) \rightarrow K(X)$ which sends $f$ to the pair $(X,f)$, and it is injective (Note: (I think) Hartshorne doesn't mention/prove explicitly this point, but it comes from the facts that open sets are dense and $K$ is a separated variety). There are some useful theorems (quite hard to prove) which allow us to compute $\mathcal{O}(X)$ and $K(X)$ (namely Thm 3.2 and Thm 3.4).

If $V$ is an open subset of $X$, then there is an embedding $K(U) \rightarrow K(X)$ (sending a pair $(U,\phi)$ to $(U,\phi)$).

I hope this will help make your mind clear about regular and rational functions (note that I didn't mention the sheaf of functions but you don't need this for this exercise).

Note : I didn't tell you how solve your exercise. You proved that there exist $f,g \in K[T_0,\dots,T_n]$ such that for all $x=(x_i)_{i=0,...,n} \in K^{n+1}$ with $x_0 \neq 0$ and $x_1 \neq 0$ : $$\frac{f(x)}{x_i^k} = \frac{g(x)}{x_j^k}.$$ This can be seen as an equality in $K(\mathbb{P}^n)$, but the 'symbols' $f(x)$, $x_i$, $g(x)$, $x_j$ are not quite elements of $K(\mathbb{P}^n)$. You may want to rewrite this expression and for this I suggest you to find a transcendence basis of $K(\mathbb{P}^n)$ over $K$.


Although I find the comments to the question and user10676's answer quite satisfying, I'll add a new perspective at Benja's explicit request to me in a comment to another question here.

If $X$ is a normal variety (for example a smooth variety), and $Y$ is a closed subvariety of codimension $\geq 2$, then the restriction morphism $\mathcal O(X)\to \mathcal O(X\setminus Y)$ is bijective.
In particular if $X$ is complete we obtain $\mathcal O(X\setminus Y)=\mathcal O(X)=k$ and this applies to your case, where you may take $X=\mathbb P^n_k$ and $Y=H_i\cap H_j$.

Unfortunately I could not locate this theorem in Hartshorne, which seems to be your reference book, but it follows from Chapter 4, Theorem 1.14, page 118 of Liu's fine book .