meaning of topology and topological space
This question is old...but I'm still going to give it a go.
Before understanding what a topology is, it is important to understand what a set is without a topology. Without a topology, a set is akin to a sealed bag full of elements: We are on the outside of the bag, and so far as we can tell, each object in the bag is indistinguishable from each other object in the bag; it is easy to see that two, or three, or four objects are unique, but beyond this, it is difficult to truly say anything about any given object in particular. The objects are simply there, and the only property that we can very truthfully assign to the bag (set) itself is the number of objects that the bag (set) contains. In other words, Cardinality is the central, and indeed only, notion which defines a set (in so far as the elements relate to one another).
Of course, in practice, we rarely work with sets whose only property is cardinality. We work with the real line, in which there is a well-defined notion of distance between elements; there is even an order which is imposed on the elements of the set. We work in the Euclidean plane, where there is no longer a well-defined, useful order between arbitrary elements, but there is now a notion of vectors, which have a notion of length attached to them (distance from the origin point), and even of angle between them. The crucial thing to notice here is that all of these very spacial, geometric properties, the added structure which makes sets like Euclidean space so very interesting, are inherently relationships between elements. The set no longer has only cardinality, but now has well-defined ways in which elements relate to one another.
Let us consider how some of these properties relate to one another in the Euclidean plane. The geometry of the Euclidean plane, in many ways, derives from its inner product. From the inner product, we can derive a formula for the cosine of an angle between vectors, and from this comes the notion of angle. We can also define a formula for a norm, a length, of vectors in the space. Thus from angle, we derive the notion of length. From the norm, we are able to derive a formula for distance: We see that a so-called inner product space implies also the structure of a so-called normed linear space, and from this, we find the structure also of a metric space. We are drilling down through increasingly lower-level geometric properties: Angle is a more strongly geometric notion than length, and length is a stronger notion than distance.
This begs the question: What geometry does a space retain when we cannot even measure a notion of distance between elements? What relation is left? What is the minimal geometric relation that a set can be endowed with? Topology offers the answer of nearness. When defining a topology on a set, a mathematician provides explicit neighborhoods for every point: He or she explicitly defines what sets of objects are considered to be near to one another. Each open set in a topology represents this extremely low-level geometric idea, which relies not even on "distance". The amazing thing about point-set topology is that, through its theorems, we come to learn how the way that points are considered near to each other, as well as how they can be distinguished, how they can be separated, and how many of them there are, affect our ability to define such relations as "distance", "angle", "completeness", and "length", which correspond to our intuition for such ideas. Thus, from a geometric perspective, point-set topology largely begins with the explicit declaration of which objects of a set are "near" to each other, and explores the implications that this hierarchy of neighborhoods has on the geometric structure of the set.
A topological space is just a set with a topology defined on it. What 'a topology' is is a collection of subsets of your set which you have declared to be 'open'. But declaring a set to be 'open' isn't quite enough: we want our open sets to be 'nice' in some way, and we want to be able to perform set operations on them to preserve this niceness.
The most intuitive example is the real line. You've probably learnt in an introductory analysis course that a subset $U \subseteq \mathbb{R}$ is 'open' if for every point $x \in U$ there is some $\varepsilon > 0$ such that $(x-\varepsilon, x+\varepsilon) \subseteq U$. Equivalently, if $\left| x-y \right| < \varepsilon$ then $y \in U$. This 'openness' has some nice properties. This generalises naturally to $\mathbb{R}^n$ where the notion of 'open ball's comes in. Namely:
- If you have any collection of open sets then their union is open
- If you have a finite collection of open sets then their intersection is open
These sets are 'nice' for all sorts of reasons, and much of the motivation comes from analysis.
(For completeness I should add that the empty set and the whole set are always declared to be open sets.)
This is just one example of a topology of $\mathbb{R}$, often called the 'Euclidean topology' (or even the 'usual topology'), but it's the one that is the most natural for use in analysis.
A topology on a set is really just a generalisation of this. You can think (at first) of open sets as being unions of open intervals, and then the way they intersect and so on behaves in the same way. Of course, this is far from what the topologies actually tell you. For instance, the cofinite topology (a one-dimensional version of the Zariski topology) doesn't behave in much the same way as the Euclidean topology at all: for instance, in the Euclidean topology it's possible to find two disjoint and nonempty open sets (e.g. $(0,1)$ and $(2,3)$), whereas in the cofinite topology any two open sets intersect in uncountably many places!
I hope this helps; though I'm not completely sure what kind of explanation you were looking for.
Here's a slightly old-fashioned way of looking at topology. Let $X$ be a set. For each $x$ in $X$, we have a non empty set $N(x)$ of subsets of $X$, which we think of as being the set of neighbourhoods of $x$. The set $N(x)$ is required to satisfy some intuitive properties:
If $U$ is a neighbourhood of $x$, then $x \in U$.
The whole set $X$ is a neighbourhood of $x$.
If $U$ is a neighbourhood of $x$, and $U \subseteq V$, then $V$ is a neighbourhood of $x$.
If $U$ and $V$ are neighbourhoods of $x$, so is $U \cap V$.
If $U$ is a neighbourhood of $x$, then there is a subset $V$ such that $U$ is a neighbourhood of every point in $V$.
In more sophisticated language, we are saying that $N(x)$ is a filter of the set of subsets of $X$ containing $x$, satisfying the additional axiom (5). Note that there usually isn't a smallest neighbourhood: for example, you should agree that each interval $(x - \epsilon, x + \epsilon)$ is a neighbourhood of $x$, but the only set contained in all neighbourhoods of $x$ is $\{ x \}$, which can't possibly be a neighbourhood of $x$ as it contains no neighours of $x$!
Now, let $Y$ be any subset of $X$. The interior of $Y$ is defined to be the subset $Y^\circ$ of all $y$ in $Y$ such that $Y$ contains a neighbourhood of $y$. This seems reasonable enough: the interior of the closed interval $[a, b]$ is $(a, b)$, because the closed interval $[a, b]$ does not contain enough neighbours of $a$ or of $b$. We say that a subset $U$ is open in $X$ if $U^\circ = U$. The set of all open subsets of $X$ has the following pleasant properties:
The whole set $X$ is open, and the empty set is open.
If $\{ U_\alpha : \alpha \in I \}$ is a set of open subsets of $X$, then the union $\bigcup_\alpha U_\alpha$ is also an open subset of $X$.
If $U$ and $V$ are open, then $U \cap V$ is also open.
Exercise. Derive these properties of open sets from the neighbourhood axioms.
If you've ever seen a modern definition of topological space, you'll recognise these properties. It turns out that knowing the set of all open subsets gives you exactly the same information as knowing $N(x)$ for every point $x$ in $X$. This leads to somewhat less intuitive developments, like topological spaces without points, but let's leave that aside for now.
What else can we do with neighbourhoods? Well, we can talk about forms of convergence. For example, let $x_1, x_2, x_3, \ldots$ be a sequence of points in $X$, and let $x$ be a point. We say that $(x_n)$ converges to $x$ just if for any neighbourhood $U$ of $x$, there is a positive integer $N$ such that $x_n \in U$ for all $n > N$. Less formally, we are saying that a sequence converges to $x$ if it is eventually always in a neighbourhood $U$ of $x$, no matter how small we pick $U$ to be! More generally, if $Y$ is any subset of $X$, a point $x$ is a limit point of $Y$ if every neighbourhood of $x$ has a non-empty intersection with $Y$. The set $\overline{Y}$ of all limit points of $Y$ is called the closure of $Y$, and a set $Y$ is closed just if $\overline{Y} = Y$.
Exercise. Show that $Y$ is closed if and only if its complement $X \setminus Y$ is open.
And, of course, we can always talk about continuity. Let $X$ and $X'$ be topological spaces. A continuous map is a map $f : X \to X'$ with the following property: if $x$ is a limit point of a subset $Y$ of $X$, then $f(x)$ is a limit point of the image of $Y$ in $X'$. This captures the intuition that a continuous map should map nearby points to nearby points: after all, if $x$ is a limit point of $Y$, then $x$ is near $Y$ in some sense, so $f(x)$ should be near $f(Y)$. In other words, the image of the closure should be contained in the closure of the image, i.e. $f(\overline{Y}) \subseteq \overline{f(Y)}$.
Exercise. Show that $f : X \to X'$ is continuous if and only if $f^{-1} U'$ is open in $X$ for every open subset $U'$ of $X'$.
Hopefully these definitions are more convincing than the usual ones. If they are, then great – because they are exactly equivalent to the usual definitions!
Clives answer might already be right up your alley but I want to link the definition of a topological space to a central concept in mathematics: Continuity
Continuity of a function $f: \mathbb{R} \rightarrow \mathbb{R}$ at a point $x_{0} \in \mathbb{R}$ roughly means that $f(x_{0})$ changes only a little if $x_{0}$ changes a little (I'm waving my hand at $\varepsilon-\delta$ here). This is a concept fundamental for example to differential calculus, which is the idea of measuring the momentary change of a given amount, like the distance a train covers "just now"; approximating the distance it covers in shorter and shorter time intervals. It leads to the notion of velocity.
Now in every (that's what I hope at least) freshman real analysis course you prove that continuity of a function $f: \mathbb{R} \rightarrow \mathbb{R}$ at a point $x_{0}$ is the same as saying that for every open neighborhood $V$ of $f(x_{0})$ there exists an open neighborhood $U$ of $x_{0}$ such that $f(U) \subset V$, that is $U$ is mapped into $V$ by $f$. But what is an open neighborhood of $x_{0}$ in $\mathbb{R}$? It's just a set $U$ containing $x_{0}$ such that every point $u \in U$ is an "interior point", which means precisely that there is a ball around $x_{0}$ with some radius $\varepsilon$ which is still completely contained in $U$.
So you see that everything that matters for the concept of continuity of a function between two sets is the notion of open neighborhood in those two sets. And this is important because it allows you to talk about continuity of a function between two sets which only have the notion of open neighborhood on defined on them. This notion of open neighborhood I'm alluding to is precisely the concept of a topological space, a set together with a collection of sets, which are called open sets, satisfying some closure conditions. That is on the one hand a very weak concept, it allows lots of pathologies which are just plain weird (see the excellent book "Counterexamples in Topology" by Steen and Seebach) and therefore a very general topological space with a very strange looking topology is most of the time not very helpful.
On the other hand just because it is such a weak notion it's not much to ask of a set to have some extra structure in form of subsets on it (though maybe some 1st-order logicians would disagree ;)). The notion of topology has become absolutely foundational, not only in analysis.\ The ramifications of the notion of a topological space, however are too far widespread to for me to give an overview of its use in many different parts of mathematics, so I just stop here.
Just to give you the upshot of my post: topology makes sense of the notion of continuity, and defining different topologies on different spaces is like allowing (and disallowing) various functions between those spaces to be continuous. Hope this is not too handwaving to the point where it becomes imprecise.
Criticism is very much welcome.
I would just like to add that there are many equivalent ways of defining a topology, using neighbourhoods, open sets, closed sets, closure, interior, and so on. (See for example my book "Topology and Groupoids".) The important fact is that these are all equivalent, i.e. each can be recovered from any one of the others.
Any tendency to say that the open set definition is THE definition of a topology is to be resisted, although in many cases it is the most convenient. However it's logical clarity can put off beginners, with good reason. Thus Peter Freyd in his book "Abelian Categories" writes: "If topology was defined as the study of families of sets closed under infinite unions and finite intersections then a serious disservice would be perpetrated on embryonic students of topology..... A better (albeit not perfect) definition of topology is that it is the study of continuous maps." There is a general discussion of "space" in this lecture, which links the notion with representation of data, and change of data.
One uses the definition which is best for the occasion at hand.