$\dim R = n-1$ if and only if $ R\cong k[x_1,\dots,x_n]/(f) $ 
Let $k$ be a field and $R$ a $k$-algebra generated by $ n<\infty $ elements. Show that the following are equivalent:
(i) $R$ is a domain of dimension $ n-1 $
(ii) $ R\cong k[x_1,\dots,x_n]/(f) $ where $ k[x_1,\dots,x_n] $  is a polynomial ring and $f$ an irreducible polynomial.

I am at a loss here. Hilbert's Nullstellensatz seems like it should apply, but I'm not sure how.
 A: Loosely speaking, this says that the dimension drops by $1$ if and only if we cut out a single equation. Note that this is false, if we drop the domain hypothesis. For instance look at $k[x,y]/(x^2,xy)$. This cannot be cut out by one polynomial, since it is not Cohen-Macaulay.

To proof your statement, note that (ii) implies (i) by Krull's principal ideal theorem.
The other direction is a consequence of two things:
(a) dimension theory of affine $k$-algebras, in particular the statement that dimension and co-dimension behave well, i.e. the height and the co-height of a prime ideal add up to the dimension of the ring.
(b) In a UFD, height one prime ideals are principal. Note that this is wrong for arbitrary height one ideals, so the proof fails without the domain assumption.
Using this, we can argue as follows: By assumption, $R \cong k[x_1, \dotsc, x_n]/I$ for some prime ideal $I$. Using (a) and $\dim R=n-1$, we get $\operatorname{height} I = 1$, i.e. $I$ is principal by (b). Hence $R=k[x_1, \dotsc, x_n]/(f)$.

Note that (b) is just a very small lemma which can be prove in two lines, but (a) is a very basic fact and one of the kickstarters of classical algebraic geometry. One has to work for this a bit and it is not trivial. One usually uses Noether normalization to show this. You can find a reference in almost any book on commutative algebra or algebraic geometry.
