TITLE: What is an algebraic variety?
QUESTION [17 upvotes]: I'm studying abelian varieties from Milne's book, but I'm having difficulty juggling different conventions and definitions of basic concepts, like those of algebraic and projective varieties. First, let me write some terminology the way I understand it. 
Classically, an affine $k$-variety is a Zariski closed (zero set of some family of polynomial), irreducible subset of $k^n$ where $k$ is any field, and an affine algebraic set is just any Zariski closed subset. A projective $k$-variety is a Zariski closed (zero set of some family of homogeneous polynomials) subset of $\mathbb P^n$. 
The definition of an algebraic ($k$-)variety is somewhat more delicate. According to Milne's Algebraic Geometry notes, an affine $k$-variety is any locally ringed space isomorphic to some $(V,\mathcal{O}_V)$ where $V$ is affine algebraic and $\mathcal{O}_V(U)$ is the set of regular functions on $U$ (rational functions with a denominator that doesn't vanish on $U$). First question: how is this definition of an affine $k$-variety related to the one above? 
Next, Milne defines an algebraic prevariety over $k$ as a locally ringed space admitting a finite open cover of affine $k$-varieties, and then an algebraic $k$-variety is a separated algebraic prevariety over $k$. What confuses me with this definition is that I don't recognize a scheme structure on Milne's definition of a variety. My second question is, is it true that the affine $k$-varieties $(V,\mathcal{O}_V)$ are affine (k-)schemes. In particular, to what ring $R$ is $(V,\mathcal{O}_V)$ isomorphic to $\operatorname{Spec} R$?
Finally, Qing Liu's definition of an algebraic $k$-variety is as follows. An affine $k$-variety is "the affine scheme associated to a finitely generated (reduced) $k$-aglebra". Which affine scheme is this? Is it simply $\operatorname{Spec} k[T_1,\dots,T_n]/I$ with $I$ radical? How does one make this association precise? Finally, Liu's algebraic $k$-variety is a $k$-scheme admitting an finite cover of affine $k$-varieties. 
I suppose the ultimate question is this. What is the relationship between affine algebraic sets in $k^n$, sheaves of reduced, finitely-generated $k$-algebras, and the scheme $\operatorname{Spec}k[T_1,\dots,T_n]/I$ where $I$ is a radical ideal, and what does it mean for a variety to be affine or projective in these contexts?

REPLY [8 votes]: Let me give a brief clarification, in order to avoid misunderstandings :    
1) The elementary approach pioneered in Serre's FAC and described in Milne only works if the base field $k$ is algebraically closed and it completely breaks down if $k$ is not algebraically closed.
One of the main advantages of Grothendieck's scheme approach is that it allows us to speak reasonably of the subscheme $x^2+y^2+1=0$ of $\mathbb A^2_\mathbb Q$  which is infinite, although of course the set of points in  $\mathbb Q^2$ satisfying that equation is empty.
The elementary approach cannot handle this situation.
2) Given a reduced finitely generated $k$-algebra $A$, the elementary approach consists in replacing $X=\operatorname {Spec}A$ by the restriction $(V,\mathcal O_V)$ of $X$ to the subspace $V=\operatorname {Specmax}A$ of maximal primes of $A$, and endowing that space with the restriction of the structural sheaf of $X$: $\mathcal O_V=\mathcal O_X\vert V$.
Of course $V$ is very different from $X$: all its points are closed and in particular $V$ has no generic point.
However one still has $\mathcal O_V(V)=\mathcal O_X(X)=A$ and all the information contained in $X$ is saved in $(V,\mathcal O_V)$.
This assertion is translated technically into the theorem that the map $X\mapsto V$ is an equivalence of categories.
Its quasi-inverse is a bit more difficult to explain: the description is in Hartshorne's Proposition II.6 .