Do there exist regular functions on the projective space over a field? Suppose $k$ is a algebraically closed field,$\mathbb{P}_k^n$ is the projective space over $k$,given the Zariski topology.A regular function on $\mathbb{P}_k^n$ is a function $f:\mathbb{P}_k^n \longrightarrow k$ which is locally a quotient of two homogeneous polynomials of the same degree with the denominator not vanishing on that open set.$\mathbb{P}_k^n$ replaced with any other variety $X$, we get a regular function on $X$(with little revision to the definition).Then do there exist such a regular function on $\mathbb{P}_k^n$?How to prove or disprove it?Some hints will be much helpful.
 A: I personally like how Shafarevich answers this question in his book Basic Algebraic Geometry: Varieties in Projective Space. It goes something like this:
First you prove that if you have a regular map $f:X\to Y$, then its graph is closed in $X\times Y$. It's easy to see that it is enough to assume that $Y$ is projective space, so we set $Y=\mathbb{P}^n$. Consider now the regular map
$$f\times\mbox{id}:X\times\mathbb{P}^n\to\mathbb{P}^n\times\mathbb{P}^n$$
where $(f\times\mbox{id})(x,y)=(f(x),y)$. We have that the graph of $f$ is then $(f\times\mbox{id})^{-1}(\Gamma)$, where $\Gamma$ is the graph of $\mbox{id}:\mathbb{P}^n\to\mathbb{P}^n$. Since regular maps are continuous with the Zariski topology, we only have to prove that $\Gamma$ is closed. But if $([x_0:\cdots:x_n],[y_0:\cdots:y_n])$ are the coordinates of $\mathbb{P}^n\times\mathbb{P}^n$, we have that $\Gamma$ is given by the equations $x_iy_j=x_jy_i$, and so is closed. 
A second theorem you'll need which is a bit more involved (and so I won't prove it here), shows that if $X$ is a projective variety and $Y$ is quasiprojective, then the second projection $p:X\times Y\to Y$ takes closed sets to closed sets.
If you have this, then you can see the following:
Theorem The image of a projective variety under a regular map is closed.
Proof If $f:X\to Y$ is regular and $X$ is projective, then we have that $f$ can factor as $x\mapsto(x,f(x))\mapsto f(x)$. We have that the graph of $f$ is closed, and then the second map is just the second projection. Because of what we said earlier, we have that the image of $f$ is closed.$\Box$
As a corollary to this, we see that if $f:X\to \mathbb{A}^1$ is a regular function and $X$ is projective (and irreducible, Hartshorne's definition includes irreducibility, Shafarevich's does not), then the image of $X$ is closed, and thus is either $\mathbb{A}^1$ or is finite. However we can see $f$ as a regular function to $\mathbb{P}^1$ also, and since its image must be closed in $\mathbb{P}^1$, it's impossible for its image to be $\mathbb{A}^1$. Thus its image must be finite. 
We have that $X=\cup_{x\in\mathbb{A}^1}f^{-1}(x)$, and if $X$ is irreducible, we must have that $f$'s image is only one point. Thus $f$ is constant, and the theorem is proved.
A: For the special case of $\mathbb{P}^n$ the proof is simpler (than the one provided in @rfauffar`s answer). As discussed In [Shafarevich, ch. 4.2], assume $f =P/Q$ on the $\mathbb{P}^n$, where $P$ and $Q$ are forms of same degree. We can assume $P$ and $Q$ have no common factors (over alg. closed field - no common roots). Then $f$ is not regular in the roots of $Q(x)$; therefore for $f$ to be regular over all of the space, the only option is that $Q(x)$ is constant, and then $P(x)$ is also constant.
Also, just to provide a more localized reference to the development in Shafarevich`s book, described by @rfauffar - it is given in the Chapter 5.6 (of the 3-rd edition), "The Image of a Projective Variety is Closed", while the desired result is the Corollary 1.1 there (p.59).
