Relation between the topology definition and the real example I'm new to topology and I find that its really difficult to relate some basic idea to a real example. Like the definition of topology below

The definition comes from the book "topology without tears".
Personally. I can understand each of the condition in the definition, however, when I also saw some real example, like the coffee cup and donut below.

How to explain these two things are the same according to the basic definition? Maybe its a wield question, but, i was stuck here for a long time.
 A: Welcome to MSE!
I had the exact same question when I first took a topology class. What you're experiencing is the difference between point set topology (which we need in order to formalize the notion of "closeness" without a notion of "distance") and algebraic topology (which is where we use this to classify "nice" spaces). For instance, the "rubber sheet" geometry you may have heard of lets you stretch and squish things because they only need to preserve which points are close to each other, without preserving any notion of "distance" between the points.
Open sets formalize this notion of "closeness", but describing exactly how is more or less the content of a topology class, so I won't be able to fit all that intuition into an MSE answer. You might think about how the open sets from a metric space encode the notion of closeness from the metric without encoding the specific distances.
If you want a good introduction to algebraic topology, I can't recommend Henle's "A Combinatorial Introduction to Topology" enough. It's set at a very approachable level, and will get you to the point where you can reason about donuts and coffee cups without worrying too much about the nitty gritty point-set topological details (which working algebraic topologists don't really worry about either, in my experience).
Edit:
I felt like I'd seen this before, and indeed I have. Here are some other questions on similar topics: (x, x, x)

I hope this helps ^_^
