This is an extremely common theorem, I have a function $f$ that maps $f:(X,\mathscr{S})\to(Y,\mathscr{T})$. I want to show that $f$ is continuous if and only if for all $V\in \mathscr{T}$, $f^{-1}(V)\in \mathscr{S}.$
I know exactly how to do this using distant function, but now I want to prove it using the definition of continuity in a topological space.
I did the forward direction by assuming that $f$ is continuous at $x\in X$, then $\forall f(x)\in V\in \mathscr{T}$, $\exists \,U$ such that $f(U)\subset V$.
Then because $f$ is continuous, I took $f^{-1}$ of both sides (actually this is the step I questioned most), then I get $U\subset f^{-1}(V)$. But then what do I do next? Can I conlude that this implies that $f^{-1}(V)\in \mathscr{S}$?