The first step in the proof is the observation that for any scheme $X$, the ring $M(X)$ of meromorphic functions is naturally identified with the direct limit of the modules Hom($J, O_X)$ as $J$ varies through quasi-coherent ideals which contain a regular section of $O_X$ Zariski-locally on $X$. Basically, such $J$ are precisely the quasi-coherent "ideals of denominators" of global meromorphic functions. This description of $M(X)$ is left to the reader as an exercise, or see section 2 of the paper "Moishezon spaces in rigid-analytic geometry" on my webpage for the solution, given there in the rigid-analytic case but by methods which are perfectly general.
Now working on Spec($A$), a global meromorphic function "is" an $A$-linear map $f:J \rightarrow A$ for an ideal $J$ that contains a non-zero-divisor Zariski-locally on $A$.
Assume $f$ is an invertible meromorphic function: there are finitely many $s_i \in J$ and a finite open cover {$U_i$} of Spec($A$) (yes, same index set) so that $s_i$ and $f(s_i)$ are non-zero-divisors on $U_i$; we may and do assume each $U_i$ is quasi-compact. Let $S$ be the non-zero-divisors in $A$. Hypotheses are preserved by $S$-localizing, and it suffices to solve after such localization (exercise). So without loss of generality each element of $A$ is either a zero-divisor or a unit. If $J=A$ then $f(x)=ax$ for some $a \in A$, so $a s_i=f(s_i)$ on each $U_i$, so all $a|_{U_i}$ are regular, so $a$ is not a zero-divisor in $A$, so $a$ is a unit in $A$ (due to the special properties we have arranged for $A$). Hence, it suffices to show $J=A$.