let a be in R, but not in K (if there is no such element, then R = K, and thus R is a field). suppose that dimK(R) = n, and consider the n+1 elements:
1,a,a2,...,an. these must be linearly dependent over K so we have c0,c1,....,cn not all 0 with:
c0 + c1a +...+ cnan = 0.
if p(x) = cnxn +...+ c1x + c0, we have p(a) = 0.
now p(x) is a non-zero polynomial with p(a) = 0, so let m(x) be a monic polynomial of least degree with m(a) = 0
(since there is at least one such polynomial with p(a) = 0, there must be one of minimal degree, which has non-zero leading coefficient, which we can therefore divide by to obtain a monic polynomial).
so me have m(a) = 0, for some polynomial m(x) = xr + dr-1xr-1 +...+ d1x + d0, with r ≤ n.
note that we cannot have d0 = 0, for if so, then m(x) factors as xq(x), and since a ≠ 0 (since a is not in K, and 0 is), then q(a) = 0, contradicting the minimality of the degree of m(x).
(this is where we use the fact that R is an integral domain. for if 0 = m(a) = aq(a), then either a = 0, or q(a) = 0, since an integral domain has no zero-divisors).
thus d0 = -d1a - d2a2-...- dr-1ar-1 - ar, so
1 = (-d1/d0 - (d2/d0)a -...- (dr-1/d0)ar-1 - (1/d0)ar-1)a
which shows that every non-zero a in R is a unit.