TITLE: Why aren’t continuous functions defined the other way around?
QUESTION [23 upvotes]: Continuity of function $f:X\to Y$ from topological space $X$ to $Y$ is defined by saying that for any open set $U_Y$, $f^{-1}(U_Y)$ is also an open set.
Intuitively, I find this weird. If we interpret “open set” informally as “a set whose elements are nearby each other” (indeed it is a set which is a neighbourhood of all its elements), then it makes intuitive sense to say that a continuous function $f$ is a function that does not “rip elements away from its neighbours”, i.e. if you input an open set $U_X$ (a set whose elements are “nearby each other”), then this should not produce a set where some elements are “not nearby each other”, i.e. it should produce an open set.
So is there an intuitive explanation at this level of abstraction (i.e. without reference to metric spaces for example) of why we don’t define continuity as “for any open set $U_X$, $f(U_X)$ is an open set”?

REPLY [2 votes]: In addition to what has already been said, I want to point out that there is no way to define a relation on points in a topological space $X$ that captures "$x$ is near to $y$", since this is a statement depending on scale. If you consider the real numbers $0$ and $0.0001$ near to each other, then just zoom in a lot and realize that maybe they aren't.
Referring to the same notion as Frunobulax did in their answer, you can define a notion of a point $x\in X$ touching a subset $A\subseteq X$. For example in the reals $0$ is intuitively touching $(0,1]$, and that stays true no matter how far you zoom in! In usual topological terms this relation is expressed as "$x$ is in the closure $\overline{A}$ of $A$". And this does indeed describe continuity in a forward fashion: If $x$ is touching $A$, then $f(x)$ should be touching $f(A)$. In other words $$f\Big(\overline A\Big) \subset \overline{f(A)},$$ which is equivalent to the usual definition of continuity.