Proof (regular rational function on irreducible projective variety is constant)

$X = \mathbb{P}^n$

Suppose $n=1$. Let $ϕ\in k(\mathbb{P}^1)$ with $ϕ = f/g$ on some open dense subset. WLOG $f,g$ have no common factors.

If $(1:α)\in \mathbb{P}^1$ and $g(1,α) = 0$, then $α$ is a root of $g(1, x_1)$. As $ϕ$ is regular at $(1:α)$, there is a representative $ϕ = h/k$ with $k(1,α) \neq 0$, so $f k - gh = 0$, and hence $f(1,α) k(1,α) = g(1,α) h(1,α) = 0$. Therefore $α$ is a root of $f(1, x_1)$. But this implies $x_1 - αx_0\mid f, g$ by homogenising $x_1 - α \mid f(1, x_1), g(1, x_1)$, which contradicts $f,g$ being coprime.

Therefore $g(1,x_1)$ has no root, hence $g(x_0, x_1) = cx_0^d$. But the same argument with respect to $x_1$ shows $d = 0$. Thus $g$ is constant, so $f$ is constant and $f/g$ is constant.

Now suppose $n>1$. If $ϕ\in k(\mathbb{P}^n)$ is non-constant and regular everywhere, find $P,Q$ with $ϕ(P) \neq ϕ(Q)$. After a linear change of coordinates (via $\mathrm{PGL}$), assume $P = (1 : 0 : \ldots : 0)$ and $Q = (0 : 1 : 0 : \ldots : 0)$. Then let $L$ be the line $\sb{(t: u: 0 : \ldots : 0)}{(t:u)\in \mathbb{P}^1}$ admits a non-constant rational function regular everywhere, contradiction.

General $X$

Any rational function $ϕ\in k(X)$ defines a morphism $ψ: X \dashrightarrow \mathbb{A}^1 \subseteq \mathbb{P}^1$ via $(g:f)$ for a representative $f/g$ of $ϕ$. Since $ϕ$ is regular, $ψ: X \to \mathbb{P}^1$ is a morphism. By completeness of $X$, $ψ(X)$ is a closed subset of $\mathbb{P}^1$, which is also proper because $(0:1)\not\in ψ(X)$. Therefore $ψ(X)$ is a finite set of points.

However $X$ is irreducible, so $ψ(X)$ is also irreducible. Thus $ψ(X)$ is one single point, so $ψ$ is constant.