Topology is that part of mathematics that deals with those aspects of geometrical objects that don't change as one deforms the object (the standard explanatory joke is that 'a topologist is someone who can't tell the difference between a coffee cup and a doughnut').

page 118 in Not Even Wrong by Peter Woit

Some nice illustrations of what kind of deformations are allowed in topology can be found here.

The doughnut and the coffee mug are topologically equivalent because one can be continuously deformed into the other (Fig. 29.1). We imagine that everything is made of some kind of mouldable clay and so all objects can be pressed and prodded so that their shape changes. However, you are not allowed to puncture or heal, to add or remove holes, so that neighbouring points in the object remain neighbouring after the deformation. […] The crucial point about topological arguments is that they do not rely on any notion of the geometrical structure of space. Topological spaces are continuously deformable and therefore a topological description reflects the underlying ‘knottiness’ of the problem.

page 260 in Quantum Field Theory for the gifted Amateur by T. Lancaster

Topology can be thought of as a kind of generalization of Euclidean geometry, and also as a natural framework for the study of continuity.Euclidean geometry is generalized by regarding triangles, circles, and squares as being the same basic object. Continuity enters because in saying this one has in mind a continuous deformation of a triangle into a square or a circle, or indeed any arbitrary shape. A disc with a hole in the centre is topologically different from a circle or a square because one cannot create or destroy holes by continuous deformations. Thus using topological methods one does not expect to be able to identify a geometrical figure as being a triangle or a square. However, one does expect to be able to detect the presence of gross features such as holes or the fact that the figure is made up of two disjoint pieces etc. This leads to the important point that topology produces theorems that are usually qualitative in nature—they may assert, for example, the existence or non-existence of an object. They will not in general, provide the means for its construction. begin by looking examples topology plays role.

page 1 in Topology and Geometry for Physicists by Nash and Sen

Topology is power.If we understand a dynamical system in topological terms, we can often deduce its qualitative features without messing around with detailed quantitative computations. As an example, I will here discuss the force between distantly separated non-Abelian monopoles. (“Distantly separated” only because we don't yet know what monopoles look like at short distances.)The Magnetic Monopole Fifty Years Later by Sidney R. Coleman

The QCD vacuum can only be understood through topological considerations. In addition, important effects in quantum field theory, like instantons, are topological effects.

The gauge fields that we commonly use in particle physics and the connections that are used in differential geometry are one and the same thing. Manifolds are studied by using connections and it was a big realization that it can be helpful to use the tools and equations that physicists developed for gauge fields, to understand manifolds better.

The 1950s and early 1960s had been a golden era for the subject of topology, and by the end of the 1960s quite a bit was known. Topology of two- dimensional spaces (think of the surface of a sphere or doughnut) is a very simple story. All two-dimensional spaces are characterised by a single non-negative integer, the number of holes. The surface of the sphere has no holes, the surface of the doughnut has one, etc. A surprising discovery was that things simplified if one thought about spaces with five dimensions or more. In essence, with enough dimen- sions, there is room to deform things around in many ways, and, given two different spaces, the question of whether one can be deformed into the other is intricate but can be worked out.

Three and four dimensions turn out to be the really hard ones, and progress in understanding them slowed dramatically. The classification of spaces by their topology depends on what sort of deformations are allowed. Does one allow all deformations (as long as one doesn't tear things), including those that develop kinks, or does one insist that the space stays smooth (no kinks) as it is deformed? It was known by the late 1960s that for spaces of dimension two and five or more, the stories for the two different kinds of deformations were closely related although slightly different.What Donaldson showed was that in four dimensions these two different kinds of deformations lead to two completely different classification schemes. The fact that he did this using gauge theory and the solutions to differential equations (parts of mathematics that topologists viewed as far from their own) just added to the surprise.page 119 in Not Even Wrong by Peter Woit

The main issue in 4-manifold theory at that time was the correspondence between the diffeomeorphism classification of simply connected 4-manifolds and the classification up to homotopy.

Donaldon's theory that was used to classify and understand four-dimensional manifolds used the Yang-Mills equations and the so-called self-duality equations.

In 1982, Simon Donaldson, then finishing his doctoral thesis at Oxford, advocated the study of the space of solutions to the Yang-Mills [field equations] on 4-manifolds as a way to define new invariants of these manifolds. Literally hundreds of papers had been written after Donaldson’s initial work in 1983, and an industry of techniques and results developed to study related problems.

Arthur Jaffe as quoted in The Proof is in the Pudding by Steven G. Krantz

In 1983, Donaldson used the Yang-Mills equations arising from physics in a purely mathematical context. Donaldson got new topological invariants for four-manifolds by studying the moduli space of solutions of the self-dual Yang-Mills equations over those four-manifolds. Donaldson’s theorem and his method of proof opened up entirely new mathematical vistas. […] What’s the advantage of being a grad student? Well, if you don’t know it’s an impossible theorem, you might actually prove it! Donaldson was messing around with all this impossible stuff, and, lo and behold, he proved something!

http://www.ma.utexas.edu/users/lfredrickson/Attachments/TempleLectures.pdf

Witten had the idea, that you could achieve the same results much simpler, if you used instead the now called “Seiberg-Witten equation”. This equation is the dual analogue of the self-duality equations:

He went to Cambridge to give a talk about his work with Seiberg to the physicists at MIT on 6 October 1994. Noticing that several mathematicians were in the audience, at the end of the talk he mentioned that this work might be related to Donaldson theory and wrote down an equation that he thought should be the dual analogue of the ones mathematicians had been studying so far (the so-called self-duality equations).

page 139 in Not Even Wrong by Peter Woit

In 1992, Ed Witten gave a talk at Harvard and Cliff Taubes was in the audience. After the talk Taubes walked up to talk with Witten. Witten told Taubes about some equations, the Seiberg-Witten equations, that he suspected that contained all the topological 4-manifold invariants that Donaldson theory was extracting from the self-dual Yang-Mills equations. Taubes went home and wrote his shortest paper–just over 15 pages!– on that. So a physicist walks up to a you as a mathematician, and says “You should be doing this,” then you go home and it works! And you have no idea why it works or why you should be doing it. We have 30 years of this pattern. Somehow the physicists know the interesting equations!

http://www.ma.utexas.edu/users/lfredrickson/Attachments/TempleLectures.pdf

This idea turned out to be correct and lead to “dramatic events”:

If Witten's idea is really correct, the Yang-Mills equations are no longer needed to study the topology of 4-manifolds.

So after that physics seminar on October 6, some Harvard and MIT mathematicians who attended the lecture communicated the remark [about the new equation] by electronic mail to their friends in Oxford, in California, and in other places. Answers soon began to emerge at break-neck speed. Mathematicians in many different centers gained knowledge and lost sleep. They reproved Donaldson's major theorems and established new results almost every day and every night. As the work progressed, stories circulated about how young mathematicians, fearful of the collapse of their careers, would stay up night after night in order to announce their latest achievement electronically, perhaps an hour, or even a few minutes before some competing mathematician elsewhere. This was a race for priority, where sleep and sanity were sacrificed in order to try to keep on top of the deluge of results pouring in. Basically ten years of Donaldson theory were re-established, revised, and extended during the last three weeks of October 1994.

page 140 in Not Even Wrong by Peter Woit

Mathematically, 4-dimensional manifolds are very different from manifolds of any other dimension! For example, one can ask whether R^n admits any smooth structure other than the usual one. (Technically, a smooth structure for a manifold is a maximal set of coordinate charts covering the manifold which have smooth transition functions. Loosely, it's a definition of what counts as a smooth function.) The answer is no - EXCEPT if n = 4, where there are uncountably many smooth structures! These “exotic R^4's” were discovered in the 1980's, and their existence was shown using the work of Donaldson using the self-dual solutions of the Yang-Mills equation, together with work of the topologist Freedman. More recently, a refined set of invariants of smooth 4-manifolds, the Donaldson invariants, have been developed using closely related ideas.

This observation is closely related to the following, physically interesting, fact:

There are no static solitons in pure Yang-Mills theory except in 4 spatial dimensions.[…] One might wonder why a phenomenon that exists only in Euclidean 4-space should concern us. The answer lies in the fact that a quantum field theory in Minkowski 4-space can be described in terms of the classical action in Euclidean 4-space, as we will show in Chapter 7.

page 87 in Quarks, Leptons & Gauge Fields by Kerson Huang

A proof an also be found there.