Serre's theorem about regularity and homological dimension One of the nicest results I know of is (Auslander-Buchsbaum-)Serre's theorem asserting that a (commutative!) local ring is regular iff it has finite global dimensional.
I'd like to ask a somewhat vague question: 

what is the history and what was the context of this result? 

By this I mean: presumably the above characterization did not come out of thin air (or just out of Serre's mind!), and there was a buildup of ideas which lead to such an elegant and, I guess, surprising characterization of regularity. Nowadays, such a thing appears almost natural to our minds brought up in the nice set-up constructed by the founders of homological algebra and tended to by a few generations already, but I suspect it was less «evident» at the time.
 A: According to Serre's definition, it suffices to prove that the Krull dimension of the commutative Noetherian ring is equal to its global dimension which is given by the projective dimension of the residue field (a result that can also be obtained via Steven Landsburg's answer). However, by considering an affine neighborhood of the ring in the scheme formed by the residue field, every point in the scheme corresponds to a prime ideal and hence to a localization. This is closely related to the concept of Galois connection: that prime ideals of a ring correspond to a point on the scheme via the Galois Connection. Therefore the Krull dimension equals the (irreducible) projective dimension of the spectrum, and is therefore equal to the minimal number of generators of the maximal ideals of the Ring, for all such localizations. There is nothing wrong with using Koszul complexes, but this fact is also true when you consider schemes and their spectra.
A: In 1953-54 E. Artin asked me to describe homological algebra to him. In addition to Ext and Tor, I decided to show him the "homological proof" of the Hilbert Basis Theorem and indicated that the same proof showed that a regular local ring had finite global dimension. Artin then mentioned the open localization problem, and I said that if the converse of the theorem I just showed him were true, the localization result would be trivial. He asked if I could prove the converse, I said no, and we both agreed that it would be nice to prove it. The question of factoriality in regular local rings also came up in that conversation, and so I set myself the goal of proving those two theorems. I persuaded Auslander to join me in that project. When Auslander and I had almost all the results, and an outline of the string of inequalities needed, Eilenberg asked to see them, we wrote them up for him, and he went to Paris with them. It was there that Serre saw the outline of our project, and he beat us to the final proof by around a week (or the time it took an air mail letter to travel from Paris to Princeton). This may clear up the questions initially posed.
A: ADDED: There is an account written by Buchsbaum (see page 1 and 2 of number 23 here) which described in more details what they wrote in [1]. So the localization problem for regular rings was definitely the main motivation for them.  
The story of this fascinating theorem is quite complicated, in fact when I was a graduate student I heard some juicy stories around it, so I took this opportunity to do some research. 
I doubt that the full truth can be known even if we could somehow talk to everyone involved, so the following is perhaps (un)educated guess at best. 
There are several components to your question, namely:
a) Who proved what?
b) What is the motivation for the statement of the theorem?
As for a), here are the relevant references:
[1] M. Auslander and D. A. Buchsbaum, Homological dimension in noetherian rings. Proc. Nat. Acad. Sci. U.S.A. vol. 42 (1956).
[2] Auslander, Maurice; Buchsbaum, David A.
Homological dimension in local rings.
Trans. Amer. Math. Soc. 85 (1957), 390–405. 
[3] Serre, Jean-Pierre.
Sur la dimension homologique des anneaux et des modules noethériens. (French) Proceedings of the international symposium on algebraic number theory, Tokyo & Nikko, 1955, pp. 175–189. Science Council of Japan, Tokyo, 1956. 
[4] Kaplansky, Irving.
Commutative rings. Conference on Commutative Algebra (Univ. Kansas, Lawrence, Kan., 1972), pp. 153–166. Lecture Notes in Math., Vol. 311, Springer, Berlin, 1973.
13-03
The result you quoted (by the way, nowadays is often known as the Auslander-Buchsbaum-Serre theorem) was announced in [1]. It stated clearly there that one of the ingredients is a Lemma by Serre (which stated that the global dimension is bound below by the number of generators of the maximal ideal) however [1] did not give  references and contained no proofs (announcing your breakthrough like that was a fairly common practice in the days before arXiv, it must be said). 
The full proofs appeared in [2], in which the Lemma was given a clear reference as [3, Theorem 4]. However, the review of [3], written by Buchsbaum, said:

The author gives an exposition of the results of M. Auslander and the reviewer [Proc. Nat. Acad. Sci. U.S.A. 42 (1956), 36–38; MR0075190 (17,705b)] and completes these results, notably by giving a homological characterization of regular local rings.  

Also, Serre's book "Local Algebra" refers to [3] for the full result (Theorem 9 there).
So it looks like [1] and [3] appeared at virtually the same time and with knowledge of each other! Unfortunately I could not find [3]. 
Perhaps the last word could be given to Kaplansky, who wrote in his survey [4]

The big theorem was proved by Auslander, Buchsbaum and Serre. (The
  Auslander-Buchsbaum portion was announced in [1], with full details in
  [2]; Serre finished the job in [3].)

OK, so what is the answer to b)? I will leave the floor to Auslander-Buchsbaum, who wrote in [1] after stating that regular local rings have finite global dimension:

Therefore, if $R$ is a regular local ring and $P$ is a prime ideal of $R$, then $gl.dim \ R_P$ is finite.... This observation, together with some direct computations, led the authors to conjecture:

Theorem. A local ring $R$ is regular if and only if $gl.dim \ R$ is finite. 
A: I don't know what Serre (or Auslander and Buchsbaum?) was thinking, but it would have been natural to observe that $R$ is regular iff its maximal ideal is generated by a regular sequence, which (by writing down the Koszul complex) implies that the residue field $k$ has finite projective dimension.  If you've already established (or have good reason to expect) that no module can have larger projective dimension than the residue field, then you're naturally led to this result.
