Let $F$ be a field. Then the field of rational fractions over $F$ in indeterminates $x_1,...,x_n$, denoted by $F(x_1,...,x_n)$, is the field of fractions of the polynomial ring $F[x_1,...,x_n]$.
P.A.Grillet ("Abstract Algebra") defines a valuation of a rational fraction $f(x_1,...,x_n)/g(x_1,...,x_n)$ at $(a_1,...,a_n) \in F^n$ as $f(a_1,...,a_n)g(a_1,...,a_n)^{-1}$, but he says it is only defined if $g(a_1,...,a_n) \neq 0$ and in this case it invariant under the change of the representative of the equivalence class which is the rational fraction. Concretely, if $f_1(x_1,...,x_n), f_2(x_1,...,x_n), g_1(x_1,...,x_n), g_2(x_1,...,x_n)$ are polynomials over $F$ so that $g_1$ and $g_2$ are nonzero and $f_1(x_1,...,x_n)g_2(x_1,...,x_n) = f_2(x_1,...,x_n)g_1(x_1,...,x_n)$, then $f_1(a_1,...,a_n)g_1(a_1,...,a_n)^{-1} = f_2(a_1,...,a_n)g_2(a_1,...,a_n)^{-1}$.
I understand why $f_1(a_1,...,a_n)g_1(a_1,...,a_n)^{-1} = f_2(a_1,...,a_n)g_2(a_1,...,a_n)^{-1}$ if $g_1(a_1,...,a_n), g_2(a_1,...,a_n) \neq 0$ and $f_1(x_1,...,x_n)g_2(x_1,...,x_n) = f_2(x_1,...,x_n)g_1(x_1,...,x_n)$ (it follows directly from the fact that evaluation $F[x_1,...,x_n]\to F$ at $(r_1,...,r_n)$ is a homomorphism of rings.
What I don't understand if why we necessarily have $g_2(a_1,...,a_n) \neq 0$ if $g_1(a_1,...,a_n) \neq 0$ and $f_1(x_1,...,x_n)g_2(x_1,...,x_n) = f_2(x_1,...,x_n)g_1(x_1,...,x_n)$. Indeed, if $g_1(a_1,...,a_n) \neq 0$ it is possible that $g_2(a_1,...,a_n) = 0$ together with $f_2(a_1,...,a_n) = 0$.