Intuition behind the definition of continuity in terms of open sets I have familiarised myself with the definition of continuity in terms of limits, each point in the codomain being 'within' an $\varepsilon$ of the domain, etc...
But my lecturer has suddenly begun using the definition "a function is continuous if for all open sets, its preimage is open"
I was wondering if someone could shed some light on the intuition behind this definition so it makes better sense in my head.
 A: You are used to the local definition of continuity (continuity at a point $x$ is expressed using $\varepsilon$ and $\delta$).
The inverse image of open is open definition is a global version of the pointwise definition. If you look at this definition from the point of view of local continuity, it might make more sense: suppose $O$ is open and $f$ is everywhere locally continuous. Then look at any $x \in f^{-1}[O] = \{p : f(p) \in O\}$.
Then $f(x) \in O$ and as $O$ is open, so $f(x)$ is an interior point of $O$, and so there is some $\varepsilon > 0$ with $B(f(x),\varepsilon) \subseteq O$. Then the local continuity gives us a $\delta>0$ such that $d(x,x') < \delta \to d(f(x), f(x')) < \varepsilon$,and some simple set theory learns us that this means 
exactly that $f[B(x,\delta)] \subseteq B(f(x), \varepsilon) \subseteq O$. But his means that $B(x,\delta) \subseteq O$, and so $x$ is an interior point of $O$. So $f^{-1}[O]$ is open. The "wiggle room" we have around $f(x) \in O$ shows that we get some "wiggle room" around $x$ to stay inside $f^{-1}[O]$, using local continuity.  
