For finite commutative rings, integral domains are the same as fields. This isn’t too surprising, because an integral domain $R$ is a ring such that for every nonzero $a\in R$ the $R$-module homomorphism $R\to R$ given by $r\mapsto ra$ is injective. Fields are those rings for which all these maps are surjective. But injective and surjective coincide for endofunctions of finite sets. Therefore, domains are the same thing as fields for finite rings.
But did you know that there is another class of commutative rings for which fields are the same as integral domains? Indeed, for self-injective rings, fields are the same as domains. By definition, a commutative ring $R$ is self-injective if $R$ is injective as an $R$-module. Note: for noncommutative rings, which we don’t consider here, there is a difference between left and right self-injective; that is, an arbitrary ring may be injective as a left module over itself, but not right self-injective, and vice-versa.
In other words, self-injective integral domains are fields. And, the proof is sort of along the lines of the one for finite rings:
Where the dotted arrow exists because $R$ is injective as an $R$-module; since it is a map $R\to R$ it is given by multiplication by some $b\in R$. Therefore $1 = ab$. .
Did you know that there is a much heavier, crazier proof using the theory essential injective extensions. What are those?! An extension of modules $A\subseteq B$ is essential if every nonzero submodule of $B$ has nonzero intersection with $A$. Such an extension is called an essential injective extension if it is essential and $B$ is an injective $R$-module. Here’s the main fact:
So, if a module $M$ is already injective, then it must be its own essential injective extension. Now we are ready to prove (again):
Injective modules are stable under pullbacks with respect to flat ring extensions: more precisely, if $R\to S$ is a flat ring extension, and $M$ is an injective $S$-module, then it is also injective as an $R$-module. The extension $R\to K$ is flat, because $K$ is obtained via localization. Because $K$ is injective as a $K$-module, it is thus injective as an $R$-module.
Since $R$ and $K$ are both essential injective extensions of $R$, we have $R = K$.