# How can a continuous function map closed sets to open sets (and vice versa)?

Definition of continuity: A function $f: X \to Y$ (where $X$ and $Y$ are topological spaces) is continuous if and only if for any open subset $V$ of $Y$, the preimage $f^{-1}(V)$ is open in $X$.

Now, if $U$ is a closed subset of $X$ (meaning that the complement of $U$, $U^c$ is open and it contains all of its cluster points) and $f(U)$ (the image of $U$ under $f$) $= V$ is open in $Y$, then if $f$ is continuous, $f^{-1}(V) = f^{-1}(f(U)) = U$ is open. So if $U$ is closed then this leads to a contradiction. Conversely, if $U$ is open in $X$ and $f(U)=V$ is closed in $Y$, then $V^c$ is open. However, the complement of the preimage $f^{-1}(V)$ is closed since $(f^{-1}(V))^c = U$ which is open; which again leads to a contradiction. If there is anyone who has some valid counterexamples I'd be eager to see them.

-
$U$ closed means $U^c$ open. There's nothing to add to that. – 1015 Mar 5 '13 at 19:03

Your argument contains several errors. For example, suppose that $U$ is open in $X$ and $V=f[U]$ is closed in $Y$. It’s true that $Y\setminus V$ is open in $Y$ and hence that $f^{-1}[Y\setminus V]$ is open in $X$, but it’s not necessarily true that $f^{-1}[Y\setminus V]=X\setminus U$; consider what can happen when $f$ is not injective (one-to-one).

Let $X$ be a space with the discrete topology; then every subset of $X$ is both open and closed, so any function $f:X\to X$ is continuous and maps open sets to open sets, open sets to closed sets, closed sets to closed sets, and closed sets to open sets.

-
So Brian M. Scott, can we say is that if f is continuous AND injective, then f maps closed sets to closed sets? – Zelyucha Mar 5 '13 at 19:56
@Zelyucha: Not necessarily, no. Let $\tau_d$ be the discrete topology on $\Bbb R$ and $\tau$ the usual topology. Then the identity map $f(x)=x$ from $\langle\Bbb R,\tau_d\rangle$ to $\langle\Bbb R,\tau\rangle$ is a continuous bijection, but $f$ maps the set $(0,1)$, which is closed in $\langle\Bbb R,\tau_d\rangle$, to $(0,1)$, which is not closed in $\langle\Bbb R,\tau\rangle$. – Brian M. Scott Mar 5 '13 at 20:00

Any constant map $f : X \to \mathbb{R}$ is continuous and maps all subsets of $X$ (open, closed, both, or neither) to a closed subset of $\mathbb{R}$.

-
Great simple example. – Brandon Thomas Van Over Sep 17 '15 at 5:41

Let $X$ be your favorite topological space, perhaps $\mathbb{R}$, and $Y$ be the space with just a single point.Then the only function $f:X\to Y$ is continuous, and, just like with Brian M. Scott's example (indeed, $Y$ has the discrete topology here), every set maps to a set which is both open and closed.

-