I was learning the definition of continuous as:
$f\colon X\to Y$ is continuous if $f^{-1}(U)$ is open for every open $U\subseteq Y$
For me this translates to the following implication:
IF $U \subseteq Y$ is open THEN $f^{-1}(U)$ is open
however, I would have expected the definition to be the other way round, i.e. with the 1st implication I defined. The reason for that is that just by looking at the metric space definition of continuous:
$\exists q = f(p) \in Y, \forall \epsilon>0,\exists \delta >0, \forall x \in X, 0 < d(x,p) < \delta \implies d(f(x),q) < \epsilon$
seems to be talking about Balls (i.e. open sets) in X and then has a forward arrow for open sets in Y, so it seems natural to expect the direction of the implication to go in that way round. However, it does not. Why does it not go that way? Whats is wrong with the implication going from open in X to open in Y? And of course, why is the current direction the correct one?
I think conceptually I might be even confused why the topological definition of continuous requires to start from things in the target space Y and then require things in the domain. Can't we just say map things from X to Y and have them be close? Why do we require to posit things about Y first in either definition for the definition of continuous to work properly?
I can't help but point out that this question The definition of continuous function in topology seems to be similar but perhaps lack the detailed discussion on the direction on the implication for me to really understand why the definition is not reversed or what happens if we do reverse it. The second answer there tries to make an attempt at explaining why we require $f^{-1}$ to preserve the property of openness but its not conceptually obvious to me why thats the case or whats going on. Any help?
For whoever suggest to close the question, the question is quite clear:
why is the reverse implication not the "correct" definition of continuous?
As an additional important point I noticed is, pointing out the difference between open mapping and continuous function would be very useful.
Note: I encountered this in baby Rudin, so thats as far as my background in analysis goes, i.e. metric spaces is my place of understanding.
Extra confusion/Appendix:
Conceptually, I think I've managed to nail what my main confusion is. In conceptual terms continuous functions are suppose to map "nearby points to nearby points" so for me its metric space definition makes sense in that sense. However, that doesn't seem obvious to me unless we equate "open sets" to be the definition of "close by". Balls are open but there are plenty of sets that are open but are not "close by", for example the union of two open balls. I think this is what is confusing me most. How is the topological def respecting that conceptual requirement?

The definition of continuity at a point $a$ for a function $f\colon A\to B$ (say between metric spaces) is: for all $\varepsilon >0$ there exists $\delta>0$ such that if $d(x,a)<\delta$, then $d(fx,fa)<\varepsilon$. Now, notice that the $\varepsilon$ is used for a condition in the codomain and the $\delta$ is used for a condition in the domain. So the order of quantification is: for all something in the codomain, there is a something in the domain such that blah blah blah. The topological definition of continuity reads: for all open in the codomain, the inverse image is open in the domain. This shows that in fact the variance in both definitions is the same: continuity of a from $f\colon A\to B$ means you can pull information back from $B$ to $A$. So, the contravariance in the definition of topological continuity is not anything you haven't seen in the metric definition already. You just always thought the metric definition is variant, but it was contravariant all the time. The topological formulation simply makes it unavoidable to notice.