(⇒) Let f be continuous and V open. Take x0∈f−1(V); then f(x0)∈V, and since V is open there is ε>0 with (f(x0)−ε,f(x0)+ε)⊂V.
Continuity at x0 gives δ>0 with ∣x−x0∣<δ⇒∣f(x)−f(x0)∣<ε.
Then every x in (x0−δ,x0+δ) satisfies f(x)∈(f(x0)−ε,f(x0)+ε)⊂V, so x∈f−1(V).
Thus x0 is an interior point of f−1(V); x0 was arbitrary, so f−1(V) is open.
(⇐) Assume the preimage of every open set is open.
For x0 and ε>0, V=(f(x0)−ε,f(x0)+ε) is open, so U=f−1(V) is open with x0∈U.
Hence some δ>0 has (x0−δ,x0+δ)⊂U, and ∣x−x0∣<δ gives f(x)∈V, i.e. ∣f(x)−f(x0)∣<ε.
Since x0 was arbitrary, f is continuous.