I am struggling to understand open maps. An open maps open sets to open sets.
Given an open map between topological spaces
$f : X \rightarrow Y$
If $U \in Y$ is open, $f^{-1}(U)$ can be open or closed as an open map can map closed sets to open sets.
What I don't understand is how if
$U \in Y$ is closed, $f^{-1}(U)$ be open.
As far as I can see this can only happen if the range of $f$ is smaller than the codomain. In other words, we can extend an open set in $U \in Y$ to a closed set $V \in Y$ with elements in the codomain whose preimage is the empty set.
Is this correct? Or are there other ways to construct an open map where the preimage of a closed set is not closed?
Remember that "closed" is not the same as "not open." In general, in a topological space $\mathcal{X}=(X,\tau)$ there are lots of sets which are neither open nor closed; more relevantly, there may be lots of sets which are both closed and open ("clopen"). The whole space and the empty set always give examples of these - so for any space $\mathcal{X}$, the identity function on $X$ is an open map and both $X$ and $\emptyset$ are open sets with closed preimage under this map - but there are also natural spaces with lots of nontrivial clopen sets, such as Cantor space (= the space of infinite sequences of $0$s and $1$s, with the topology generated by sets of the form $\{f: \sigma\prec f\}$ for $\sigma$ a finite binary string; alternately, the Cantor set with the subspace topology as a subset of $\mathbb{R}$ with the usual topology).