Proof (regular rational function on affine variety)
$A(X) \subseteq O_X(X)$ is obvious: for any $f\in A(X)$ and $x\in X$, $f = f/1\in O_{X,x}$ as $1\not\in \mathfrak{m}_x$.
Conversely suppose $ϕ\in O_X(X)$. Define an ideal of $A(X)$ $$ \begin{align*} I_ϕ = \sb{h\in A(X)}{h\cdot ϕ\in A(X)} \end{align*} $$ which we claim equals $A(X)$.
If on the contrary $I_ϕ$ is proper, then (viewing $I_ϕ$ as an ideal of the Noetherian ring $k[x_1 ,\ldots, x_n]$) there exists some maximal ideal $\mathfrak{m}_x$ of $A(X)$ such that $I_ϕ \subseteq \mathfrak{m}_x$. As $ϕ \in O_{X,x}$, we can write $ϕ = f/g$ where $g(x) \neq 0$, so $g\not\in \mathfrak{m}_x$. However $g\in I_ϕ$ as $g\cdot ϕ\in A(X)$, contradicting $I_ϕ \subseteq \mathfrak{m}_x$.
Therefore $I_ϕ = A(X) \ni 1$ so $ϕ = 1\cdot ϕ \in A(X)$.