Why topology on a set is defined the way it is? Following is from Wolfram Mathworld  
"A topological space, also called an abstract topological space, is a set X together with a collection of open subsets T that satisfies the four conditions:


*

*The empty set is in T.

*X is in T.

*The intersection of a finite number of sets in T is also in T.

*The union of an arbitrary number of sets in T is also in T. " 
http://mathworld.wolfram.com/TopologicalSpace.html
My question is why topology on a set is defined in this way? How these definition connect with our intuitive idea of different kind of topological space (i.e line, graphs, 3-sphere, torus etc). 
I am obviously new in topology and will be glad if you explain in basic term. I'd be specially interested to know how one differentiate between a straight line segment and a "Y" shaped graph using these definitions. 
I have convinced myself of one way, please let me know if it is correct. I can separate Y naturally in three segment let's name them a,b and c. 
Let X={a,b,c}.
So the topology Y on X will be { {},{a,b,c},{a,b},{a,c},{b,c},{a},{b},{c}}. 
We can break a line segment on three part. Let's do likewise for line segment l. 
So the topology l on X will be { {},{a,b,c},{a,b},{b,c},{b}}. 
Topology Y and l are on X and obviously different. :)
 A: The original definition of a topology on a set was given by Hausdorff in 1914 and involved what he called neighbourhoods. Basically he defined a topology on a set $X$ as a collection of subsets of $X$ for each point of $X$, where these subsets (or neighbourhoods) are required to satisfy certain axioms (e.g. each neighbourhood of $x\in X$ must contain $x$ itself; see here for a list of them). Actually his definition carved out a slightly more regular kind of topological space (nowadays called Hausdorff, go figure). Anyway, later other people (I guess Bourbaki was involved) realized that you could just as well use open sets to define a topological space. In this context, an open set is defined as a subset containing a neighbourhood for each of its points.
Regarding your intuition about differentiating between different topological spaces, I don't know whether your attempt can be put on a solid footing (for instance, you seem to mix up the notion of open sets and of "segments"). You must also notice that apparently different topologies can actually describe the same space (the key word here is homeomorphic). So looking at the actual open sets is not necessarily a good way to distinguish among topological spaces. Usually topologists show that the interval space and the Y-space are not homeomorphic by showing that if you remove any single point from the interval you get a space with two pieces (called connected components), but if you remove the intersection point from the Y-space you get a three-components space. In general the business of distinguishing among non-homeomorphic topological spaces is hard and inspired people to come up with a lot of interesting ideas. Basically every topological notion you find in a topology textbook is a good candidate to distinguish between spaces: connectedness, compactness, separation properties, homotopy, homology...
Good luck with your studies.
A: This may be motivated by metric spaces: If you define an open set in a metric space $(M,d)$ to be a set $U$ such that 
$$\text{for each $x\in U$ there is an $ε>0$ such that $B(x,ε)⊆U$}\quad (*)$$then these sets satisfy exactly the axioms for a topological space. The intuition of the property $(*)$ is that the point $x$ has enough "wiggle room" around it in the set $U$. Then we can forget about the metric, and just keep the family of open sets, and we see that some properties of $M$, like connectedness, can be proven using only the open sets, meaning that they depend only on the topology.
There are actually several equivalent definitions of a topological space. The one you asked about uses open sets. Another one uses neighborhood filters instead: For each $x$ in the set $X$, we have a non-empty collection $\cal N_x$ such that 


*

*Each $N\in\cal N_x$ contains $x$,

*For each $N,M\in\cal N_x$, we have $N\cap M\in\cal N_x$,

*For each $N\in\cal N_x$ and $K\supset N$, we have $K\in\cal N_x$,

*For each $N\in\cal N_x$, there is an $M\in\cal N_x$ such that $N\in\cal N_y$ for each $y\in M$.


We can then define a set $U$ to be open if
$$\text{ $U$ is a neighborhood of $x$ for each $x\in U$}\quad (**)$$
and this collection $\cal O$ is then a topology on $X$.
Compare this with the definition of an open set in the metric space $M$. If we define $\cal N_x$ for $x\in M$ to be the collection of all supersets of balls $B(x,ε)$ for $ε>0$, then these collections satisfy the four axioms above, and an open set in the sense $(**)$ is exactly an open set in the sense $(*)$.  Actually, it suffices that they satisfy the first three axioms in order for $\cal O$ to be a topology, but the fourth property ensures that each $N\in\cal N_x$ is indeed a neighborhood of $x$ according to the definition of a neighborhood in a space equipped with a topology. (Each neighborhood contains an open set containing $x$).
A: As for the intuition behind the concept of a topological space, see MO/19152. My favorite answer is this one.
