What is the role of Topology in Mathematics? Is it like Logic that you need in every areas of math?
Topology deals with generalizations of the intuitive concept of "closeness", as in point $a$ lies close to point $b$. It does so, however, without requiring an actual measure of closeness, like for example $||b-a||$.
Topology thus tends to play an important role in those areas of mathematics where such a concept of "closeness" can be applied. Function analysis, for example, deals (amongst other things, of course) with the many different ways that one can define closeness of two functions.
But topology also has strong connections to set theory, and thus to logic. It thus sometimes pops up even in areas where it is not immediatly obvious that there is any meaningfull definition of "close".
One beautifull example is the compactness theorem in logic. In it's usual form, that theorem says that for an arbitrary (infinite) set of logical assumptions to be consistent it is sufficient for every finite subset to be consistent. Somewhat surprisingly, there's a topological interpretation of that theorem. By introducing a suitable topology on the set of all consistent sets of formulas, the theorem becomes equivalent to the compactness (in the topological sense) of a certain set.
Other connections between logic and topology arise from the study of ultrafilters and nets, which are generalizations of the concept of convergence. Using these concepts, one can, for example, construct a model of an (arbitrarily large!) set of formulas if one assumes that every finite subset has a model.
(Logical formula refers to first-order logic here)
You can find a lot of interesting information about your question on some below source: