What are some results that shook the foundations of one or more fields of mathematics? An example would be the proof that $\sqrt{2}$ is not rational, which was a violation of some fundamental assumptions that mathematicians at the time made about numbers. Another would be Russell's paradox, which proved that naive set theory contains contradictions. I'm looking for a list of examples of similar results which forced mathematicians to change widely held beliefs and rebuild the foundations of their field. How did mathematicians at the time rearrange their foundations to account for newly proven results?
There must be lots of examples.
EDIT
The question was put on hold as too broad. Hopefully this narrows it a bit. I am looking for examples where most mathematicians believed that a certain foundational set of propositions was true, and then a result was proven that showed that it was false. Most theorems do not fit the bill. Wiles' proof of Fermat's last theorem was a historic achievement, but as far as I am aware, it did not force Wiles' contemporaries to reevaluate their fundamental assumptions or beliefs about mathematics. Gödel's incompleteness theorems, on the other hand, showed that Hilbert's program was unattainable, causing a fundamental shift in our understanding of notions like provability.
EDIT
I don't understand why this keeps being closed. It seems to be generating quality answers and the answerers seem to be able to tell what is being asked. Maybe some commenter could let me know?
 A: Gödel's incompleteness theorem -- any formal system with a reasonable level of descriptive power contains statements that are both true and unprovable. And these statements can be constructed. 
The construction of hyperbolic geometry -- satisfies all of Euclidean axioms except the parallel postulate. 
A: The Weierstrass function, continuous everywhere, differentiable nowhere. Very cool.
A: Russell's Paradox, showing that a naive viewpoint towards sets is not consistent (and destroying Frege's work at the time).  While this didn't start the interest in developing the axiomatic method, it was certainly a major motivating factor once it was found and has shaped our foundations of set theory immensely. 
A: The discovery of continuous functions that were nowhere differentiable caused a great tormoil among mathematicians in the $19$th century, since those functions (continuous) were considered to be well-behaved, except maybe at a few points. And we have Weierstrass function as an ilustration of that. 
In order to give more historical background and mathematical insight here is an interesting paper.
A: The discovery of exotic spheres by John Milnor in 1956. These are topological spheres carrying a smooth structure different from that of a standard smooth sphere. Their discovery divided the study of manifolds into two disciplines: topological manifolds and smooth manifolds.
A: *

*The first example (which quite possibly was the cause for mathematics to be studied as a "safe" subject in the first place, was Parmenides, who (reportedly: the original source is unreadable) showed that by naïve philosophical reasoning there could only be one thing in the world. The conclusion, there being more than one thing in the world, was that all natural philosophy up till then had been built on nonsense, since you could deduce rubbish. (Parmenides was Zeno's teacher, to give you a reference point you have heard of.) Here is also born the unreasonable, devastating skepticism we still use in science, and particularly mathematics, to test theories and results to this day.

*The next quake in Greek mathematics that we know about is the discovery of non-comeasurable magnitudes. This is what you probably know as "irrational numbers". However, the Greek method of measuring line segments is to measure one with another, hence comeasure. You stack copies of one end-to-end, and copies of the other end-to-end, to find the point when they have a common length. (The actual algorithm is more complicated—look up anthyphairesis. Or, of course, Euclid's algorithm. Both give you the common unit measure-line, of which the line lengths are multiples) For the side and diagonal of a square, this process doesn't end, so the side and diagonal of the square are not comeasurable. This gives you serious problems when your number system is entirely based on comeasurability. (And nowhere has the word "irrational" been used. The Greeks could not have discovered "irrational numbers", because they had no way to express such an idea.) So does that mean there are different types of length? Well, eventually Eudoxus sorts that one out, by inventing the theory of proportion that we find in Euclid. Eudoxus is one of the smartest mathematicians ever, up there with Newton and Gauss, and this was a Big Deal.

*Hindu numerals. No, really. Totally changed commercial arithmetic. Allowed the purchase and sale of debt, so banking is invented and the world comes to an early end.

*Non-example: proving that the three classical problems (squaring the circle, doubling the cube, and trisecting the angle), cannot be done with ruler and compass. Even the Greeks suspected it was impossible (circle-squarer is used as a "Ha, what an idiot"-type insult in Aristophanes's play The Birds).

*Non-example: Infinitesimals (I mean the old sort, used from basically the 15 century on) are paradoxical. Although everyone knows this from about 1550 on, they carry on using them (carefully...) anyway. Because you still get the right answer for anything physically reasonable that you are considering.

*Curves are equations and equations are curves. This is the first revolution in geometry: Descartes's invention of algebraic geometry. Suddenly you can do geometry using algebra, and algebra using geometry. Before, they appeared to be two rather different things, algebra being far more suspicious and dodgy because it's not synthetic: you start with something unknown, then find it. After this, both can be used in tandem.

*The second revolution in geometry is Riemann. Very little interest is shown in hyperbolic geometry: Gauss doesn't bother to publish it, and Boylai and Lobachevsky's work is almost completely ignored when it isn't rubbished. But Riemann takes Gauss's theory of surfaces and a) completely changes complex analysis and the theory of abelian functions, freeing it from the plane, and b) explains how to a geometry with intrinsic curvature can work. This circulates through the Italian school, until eventually some chap called Einstein happens upon it.

A: *

*Goedel's incompleteness theorems - forcing one to understand the limitations of formal languages.

*Skolem's theorems - forcing one to reconsider everything they new about first order logic.

*Robinson's infinitesimals - showing they really do exist.

*Cantor's set theory - creating a heaven for us all.

*The discovery of non-Euclidean spaces - settling Euclid's fifth, and opening the door to much of modern geometry.

*The existence of transcendental numbers - showing how shaky our initial understanding of the reals was.

*The insolvability of the general $n$-degree polynomial, $n\ge 5$, by radicals - for the result itself and the far reaching tools and techniques created.

A: Although possibly not the same level as the examples above, Hilbert's basis theorem received a lot of criticism (someone called it theology) since it was not a constructive proof.
A: The axiom of choice would be another such result--seemingly innocent in its statement but quite far-reaching in terms of its applications and implications.
A: Galois (and Abel) showed that one can only get so far in solving polynomials using radicals. 
Cohen showing the continuum hypothesis is not provable, was a shocker and it changed set theory entirely. Arguably set theorists were close to adding $V=L$ to the "canonical" set theoretic axioms, but Cohen's work showed that there is a whole world outside of $L$!
And of course Cantor's work. Finding out that there are different infinities? Mind blowing.  
Cauchy and the finitary definition of limits was a foundational cornerstone for modern analysis, which shook the foundations in a positive way. 
A: I am no expert but I believe Gödel's incompletness theorems should be included as they shook the widely held idea that every true result in mathematics is provable (within an axiomatic system + constraints), and this was something that surprised the likes of B. Russell and D. Hilbert amongst others.
