Let $(X, \mathscr T_X)$ and $(Y, \mathscr T_Y)$ be topological spaces and $f: X \to Y$. $f$ is continuous iff $f^{-1} (E) \in \mathscr T_X $ for every $E \in \mathscr T_Y$.
My doubt is:
I dont know if $f$ is bijective so how can I define $f^{-1}(E)$?
First of all, this is not a theorem but the definition of continuity. Second, note that $$f^{-1}(E) := \{ x \in X \mid f(x) \in E\}$$
so there is absolutely no requirement of $f$ being injective or even bijective.