Solution (source code)

= Solution

The <fraction field> of an <integral domain> $R$ is a <field> $F$ containing an identified copy of $R$ in which every element has the form $a/b$ with $a,b\in R$ and $b\ne0$. Equality means $a/b=c/d$ exactly when $ad=bc$; the operations are the usual addition and multiplication of fractions. We use unital <ring homomorphisms>.

Since $\varphi$ is <injective>, $\varphi(b)\ne0$ whenever $b\ne0$. Define
$$
\boxed{\Phi(a/b)=\varphi(a)\varphi(b)^{-1}.}
$$
If $ad=bc$, applying the <ring homomorphism> and dividing by $\varphi(b)\varphi(d)$ proves the value is independent of the representative. The fraction addition and multiplication rules show that $\Phi$ preserves both operations and one, and $\Phi(a/1)=\varphi(a)$. If $\Phi(a/b)=0$, then $\varphi(a)=0$, so $a=0$ because $\varphi$ is an <injective function>; therefore its <kernel> is zero and $\Phi$ is <injective>. It is also the unique extension, because any <ring homomorphism> extending $\varphi$ must send $b^{-1}$ to $\varphi(b)^{-1}$.

For a counterexample, take $R=\mathbb Z$, $F=\mathbb Q$, and reduction modulo two $\psi:\mathbb Z\to\mathbb Z/2\mathbb Z$. An extension would give $1=\Psi(2)\Psi(1/2)=0$, a contradiction. \b[Nonzero denominators must become invertible in the target; an arbitrary ring homomorphism need not have that property.]