For a long time I have had an intuition on what topology is, without ever formally studying it. i.e the classic example of a mug being the same, topologically, as a doughnut, by stretching and reshaping while retaining "holes".
I have recently started studying it formally, with the idea of a topology of a set being closed under unions and finite intersections etc. I can understand these definitions, but in no way can I relate these to my initial intuitive understanding of what topology is; they seem like separate subjects altogether.
Could someone please help bridge this gap in my understanding?
One thing I’ll mention is that the defining properties of a topology (open sets being preserved by arbitrary unions, finite intersections, and the total and empty sets being open) can naturally be derived from a metric space. One way we can approach topology is by looking at these properties as being derived from a metric space (where openness is defined in terms of balls), and to simply drop the notion of a metric.
In a metric space, we have the notion of continuity of functions being defined in terms of an $\epsilon$-$\delta$ definition, but this can be extended to a notion of continuity for topologies. Topology then in a lot of ways is the study of properties that remain invariant under homeomorphisms which are continuous invertible mappings where the inverses are continuous as well. Properties like holes are topological invariants in this sense, but there more sophisticated tools that are needed in order to understand them. These tools include the fundamental group (equivalence classes of loops/closed paths a space will admit) as well as homology/cohomology groups.