Failures that lead eventually to new mathematics 
Possible Duplicate:
Most interesting mathematics mistake? 

In the 25-centuries old history of Mathematics, there have been landmark points when a famous mathematician claimed to have proven a fundamental statement, then the proof turned out to be false or incomplete, and finally  the statement became a nice problem playing  an important role in the development of Mathematics. Two immediate examples come to me:


*

*Fermat's last theorem,

*the existence of a minimizer of the Dirichlet integral in calculus of variations, which led Weierstrass to introduce the notion of compactness.
This must have happened in almost all branches of Mathematics.

What are the best examples of such an evolution? How did they influence our every mathematical life?

 A: Dulac in 1923 claimed to have proven

Any real planar differential equation
  $$\frac{dx}{dt} = Q(x,y) \qquad \frac{dy}{dt} = P(x,y) $$
  where $P,Q$ are polynomials with real coefficients, has a finite number of limit cycles.

Limit cycles are the main objects in the second part of the Hilbert 16th problem
His proof turned out to have a large hole.ref  It took until the 1980s and the (independent) work of Écalle on resummation and the Borel-Laplace tranform, and the work of Ilyashenko on analytic continuation in the complex plane of the Poincaré first real return map associated to polycycles.  Both of these strands of work are phenomenal achievements, and bore fruit for quite some time (maybe still does, but I stopped following this area some years back).
A: In the early 1960's Smale published a paper containing a conjecture whose consequence was that (in modern language) "chaos didn't exist". He soon received a letter from Norman Levinson informing him of an earlier work of Cartwright and Littlewood which effectively contained a counterexample to Smale's conjecture. Smale "worked day and night to resolve the challenges that the letter posed to my beliefs" (in his own words), trying to translate analytic arguments of Levinson and Cartwright-Littlewood into his own geometric way of thinking. This led him to his seminal discovery of the horseshoe map, followed by the foundation of the field of hyperbolic dynamical systems. For more details, see Smale's popular article "Finding a horseshoe on the beaches of Rio", Mathematical Intelligencer 20 (1998), 39-44.
A: An important moment for chaos theory and dynamical systems was the discovery by Phragmén that there was a problem with the convergence of a series in Poincaré's original submission to a competition organised as part of the 60th-anniversary celebration of the birth of Oscar II, King of Sweden and Norway. The rewritten paper is seminal. The story is well told by June Barrow-Green in Poincaré and the three body problem (1997).
A: Another thing that comes into mind (with connection to the FLT), is the unique factorization in the ring of integers of a number field.
That was the basic mistake in Cauchy's and Lamé's proof of the FLT given to the french academy.
It motivated a large development in algebraic number theory (definition of the class number and so on) by Kummer,Dedekind and others. And later obviously was generalized in the field of commutative algebra.
A: In some sense it was a failure of a certain diagram to commute that led to the Symmetric Spectra, S-modules, and other modern theories of spectra. Since these concepts underlie a lot of modern stable homotopy theory, everyone knows some version of this story. The category of spectra (not symmetric or S-algebras) goes back to Lima's 1959 paper The Spanier-Whitehead Duality in New Homotopy Categories, and is a natural construction if you want to do stable homotopy theory. Inverting the stable homotopy equivalences we get the stable homotopy category.
The "failure" I promised above is the failure of this category of spectra to have a symmetric monoidal structure. Such a structure was desired as a way to do more algebra in this setting (without it you have no hope of ring objects or modules over them). The diagram I mentioned which failed to commute was the diagram arising from the smash product on spaces, which the move to spectra did not preserve. For about 40 years it was thought that you could not have a symmetric monoidal category on spectra. See for instance the Lewis's 1991 paper Is there a convenient category of spectra? which shows that you can't have all the properties you want on such a category and also have it be symmetric monoidal. Thankfully, you can get enough of the properties you want and also get it to be symmetric monoidal. This was shown at the same time by two different teams of mathematicians:


*

*Elmendorf, Kriz, Mandell, and May created the category of $S$-modules

*Hovey, Shipley, and Smith created the category of symmetric spectra


Both are symmetric monoidal categories of spectra, have (different) desirable homotopy-theoretic properties, and both give the stable homotopy category when you invert weak equivalences. It turns out both approaches are equivalent in an even stronger sense than this, as can be seen for example in Schwede's S-modules and symmetric spectra.
[Disclaimer] This answer tells a story but may be missing important details or have things slightly wrong. That's because as a current graduate student I wasn't doing math at the time of these developments. So I'm glad this answer is CW so someone more knowledgeable can come and edit this if I got it wrong.
I think there's also a way to fit operads into this story, since every time I think of operads I think of $A_\infty$ and $E_\infty$ ring objects, which are ones where a key structural diagram (associativity and commutativity, respectively) does not commute on the nose, but it does commute up to homotopy. However, the coherence diagram doesn't commute up to homotopy, but does up to homotopies of homotopies. And for it's coherence diagram you need homotopies of homotopies of homotopies, etc. It seems to me that this arises from a similar goal as the above, namely to do algebra in stable homotopy theory. Before the issue was a lack of a product, but now the issue is that the product doesn't follow the rules (but it does up to infinitely coherent homotopy).
A: This doesn't exactly fit, but I thought it might be close enough to be worth mentioning.  The Fundamental Lemma in the Langlands Program was (as implied by the name) originally expected to be relatively easy result.  Much of the program depended on it, and yet the Lemma remained unproven for about 2 decades until Ngô Bảo Châu's recent proof appeared.
A: Lebesgue claimed that the projection of a Borel subset of the plane is a Borel set itself, an erroneous assertion that led the then 23 year old Mikhail Souslin to the definition of an analytic set (i.e. sets that are projections of closed sets). Before his untimely death in 1919 at the age of 25 he was able to prove that a set $A$ is Borel iff $A$ and its complement are both analytic- a discovery that initiated the field of descriptive set theory.
A: A nice example of a mistake that caused a big setback to its field
when discovered, and led to a big upsurge when it was finally fixed,
was Dehn's lemma in 3-manifold topology.
Dehn used the lemma in 1910, believing he had proved it, and for a
long time it was thought to have established a simple connection
between knots and the fundamental group.
In 1929, Helmuth Kneser discovered a mistake in Dehn's proof, which
wrecked his plan to write a book on 3-manifolds based on Dehn's
lemma, and probably caused him to change fields fo several complex
variables.
The field of 3-manifolds did not become very active again until
Papakyriakopoulos finally proved Dehn's lemma in 1957.
