[proofplan]
Part (i) is established by a concrete counterexample: a constant map $f: \mathbb{R} \to \mathbb{R}$, $x \mapsto 0$, is continuous but pulls the nowhere dense singleton $\{0\}$ back to the entire space $\mathbb{R}$, which is not nowhere dense. Part (ii) uses the [equivalent characterisation](/theorems/1084) (iii) of nowhere dense sets: given a nonempty open $V \subset Y$, we pull back to $f^{-1}(V)$, find a nonempty open $H \subset f^{-1}(V)$ disjoint from $A$, push forward via the open map to get a nonempty open $f(H) \subset V$, and verify $f(H) \cap f(A) = \varnothing$ using injectivity.
[/proofplan]
[step:Prove (i) by constructing a constant map counterexample]
Let $X = Y = \mathbb{R}$ with the standard topology. Define the constant map
\begin{align*}
f: \mathbb{R} &\to \mathbb{R} \\
x &\mapsto 0.
\end{align*}
This map is continuous: for any open $U \subset \mathbb{R}$, $f^{-1}(U) = \mathbb{R}$ if $0 \in U$ and $f^{-1}(U) = \varnothing$ if $0 \notin U$, and both $\mathbb{R}$ and $\varnothing$ are open.
Set $A := \{0\}$. Since $\{0\}$ is closed in $\mathbb{R}$, $\overline{A} = \{0\}$. No open interval $(a, b)$ is contained in $\{0\}$, so $\operatorname{int}(\overline{A}) = \varnothing$ and $A$ is nowhere dense in $\mathbb{R}$.
However, $f^{-1}(A) = f^{-1}(\{0\}) = \mathbb{R}$. Since $\overline{\mathbb{R}} = \mathbb{R}$ and $\operatorname{int}(\mathbb{R}) = \mathbb{R} \neq \varnothing$, the preimage $f^{-1}(A)$ is not nowhere dense in $X$.
[guided]
We need to exhibit a continuous map $f: X \to Y$ and a nowhere dense set $A \subset Y$ whose preimage $f^{-1}(A)$ is not nowhere dense in $X$.
The strategy is to choose $f$ so that $f^{-1}(A)$ is as large as possible — ideally all of $X$. A constant map achieves exactly this: every point of $X$ maps to the same value, so the preimage of a singleton is the entire domain.
Let $X = Y = \mathbb{R}$ with the standard topology and define
\begin{align*}
f: \mathbb{R} &\to \mathbb{R} \\
x &\mapsto 0.
\end{align*}
Continuity: for any open $U \subset \mathbb{R}$, $f^{-1}(U)$ is either $\mathbb{R}$ (when $0 \in U$) or $\varnothing$ (when $0 \notin U$). Both are open.
Set $A := \{0\}$. We verify $A$ is nowhere dense: $\{0\}$ is closed (its complement $\mathbb{R} \setminus \{0\}$ is open), so $\overline{A} = \{0\}$. For the interior, $\operatorname{int}(\{0\}) = \varnothing$ because no open interval $(a, b)$ with $a < b$ is contained in the single-point set $\{0\}$.
The preimage: $f^{-1}(\{0\}) = \{x \in \mathbb{R} : f(x) = 0\} = \mathbb{R}$. Since $\operatorname{int}(\overline{\mathbb{R}}) = \operatorname{int}(\mathbb{R}) = \mathbb{R} \neq \varnothing$, the set $f^{-1}(A) = \mathbb{R}$ is not nowhere dense.
What goes wrong? The constant map is continuous but far from being open: it sends every open interval to $\{0\}$, which is not open. This extreme failure of openness is what allows the preimage to "inflate" a nowhere dense set into the entire space. Part (ii) shows that requiring $f$ to be open and injective prevents this inflation when the nowhere dense set is in the domain.
[/guided]
[/step]
[step:Prove (ii) by pulling back, avoiding, and pushing forward via the open map]
Assume $f: X \to Y$ is continuous, open, and injective, and that $A \subset X$ is nowhere dense in $X$. We show $f(A)$ is nowhere dense in $Y$ using the [equivalent characterisation](/theorems/1084) (iii): it suffices to show that every nonempty open $V \subset Y$ contains a nonempty open subset disjoint from $f(A)$.
Let $V \in \tau_Y$ be nonempty. If $V \cap f(X) = \varnothing$, then $f(A) \subset f(X)$ gives $V \cap f(A) = \varnothing$, and $W := V$ satisfies (iii). So assume $V \cap f(X) \neq \varnothing$, which gives $f^{-1}(V) \neq \varnothing$.
Since $f$ is continuous, $f^{-1}(V)$ is open in $X$. Since $A$ is nowhere dense, characterisation (iii) provides a nonempty open $H \subset f^{-1}(V)$ with $H \cap A = \varnothing$.
Define $W := f(H)$. We verify the required properties:
- **$W$ is open in $Y$:** $f$ is an open map and $H$ is open in $X$, so $f(H)$ is open in $Y$.
- **$W$ is nonempty:** $H \neq \varnothing$ implies $f(H) \neq \varnothing$.
- **$W \subset V$:** Since $H \subset f^{-1}(V)$, we have $f(H) \subset f(f^{-1}(V)) \subset V$.
- **$W \cap f(A) = \varnothing$:** Since $f$ is injective, for all subsets $S_1, S_2 \subset X$, $f(S_1 \cap S_2) = f(S_1) \cap f(S_2)$. Applying this identity:
\begin{align*}
f(H) \cap f(A) = f(H \cap A) = f(\varnothing) = \varnothing.
\end{align*}
Therefore every nonempty open set $V \subset Y$ contains the nonempty open subset $W = f(H)$ with $W \cap f(A) = \varnothing$, and $f(A)$ is nowhere dense by characterisation (iii).
[guided]
Assume $f: X \to Y$ is continuous, open, and injective, and that $A \subset X$ is nowhere dense. We must show $f(A)$ is nowhere dense in $Y$.
The strategy has three phases: **pull back** to $X$, **avoid** $A$ using the nowhere dense property, then **push forward** via the open map.
We use the [equivalent characterisation](/theorems/1084) (iii): $f(A)$ is nowhere dense if and only if every nonempty open $V \subset Y$ contains a nonempty open subset disjoint from $f(A)$.
Let $V \in \tau_Y$ be nonempty.
**Case 1:** $V \cap f(X) = \varnothing$. Then $f(A) \subset f(X)$ gives $V \cap f(A) = \varnothing$, and $W := V$ satisfies (iii).
**Case 2:** $V \cap f(X) \neq \varnothing$, so there exists $x \in X$ with $f(x) \in V$, giving $x \in f^{-1}(V) \neq \varnothing$.
**Pull back.** Since $f$ is continuous, $f^{-1}(V) \in \tau_X$. So $f^{-1}(V)$ is a nonempty open subset of $X$.
**Avoid.** Since $A$ is nowhere dense in $X$ and $f^{-1}(V)$ is nonempty open, the [equivalent characterisation](/theorems/1084) (iii) provides a nonempty open $H \subset f^{-1}(V)$ with $H \cap A = \varnothing$.
**Push forward.** Define $W := f(H)$. Since $f$ is an open map and $H$ is open, $W$ is open. Since $H \neq \varnothing$, $W \neq \varnothing$. Since $H \subset f^{-1}(V)$, applying $f$ gives $W = f(H) \subset f(f^{-1}(V)) \subset V$.
**Disjointness.** This is where injectivity of $f$ is consumed. For an injective function $f: X \to Y$, the identity $f(S_1 \cap S_2) = f(S_1) \cap f(S_2)$ holds for all subsets $S_1, S_2 \subset X$. To verify the non-trivial inclusion $\supset$: if $y \in f(S_1) \cap f(S_2)$, then $y = f(s_1) = f(s_2)$ for some $s_1 \in S_1$, $s_2 \in S_2$; injectivity forces $s_1 = s_2 \in S_1 \cap S_2$, so $y \in f(S_1 \cap S_2)$. Applying this:
\begin{align*}
f(H) \cap f(A) = f(H \cap A) = f(\varnothing) = \varnothing.
\end{align*}
Why is injectivity essential? Without it, $f(H) \cap f(A) = \varnothing$ can fail even when $H \cap A = \varnothing$: two distinct points $h \in H$ and $a \in A$ might satisfy $f(h) = f(a)$, placing $f(a)$ in both $f(H)$ and $f(A)$. A concrete example: let $X = \mathbb{R}^2$, $Y = \mathbb{R}$, and let $\pi_1: \mathbb{R}^2 \to \mathbb{R}$ denote projection onto the first coordinate, $(x_1, x_2) \mapsto x_1$. The map $\pi_1$ is continuous and open (it sends the open rectangle $(a,b) \times (c,d)$ to the open interval $(a,b)$). The set $A = \mathbb{R} \times \{0\}$ is nowhere dense in $\mathbb{R}^2$ (its closure is itself, and a horizontal line has empty interior in the plane), but $\pi_1(A) = \mathbb{R}$, which is not nowhere dense in $\mathbb{R}$.
The open set $W = f(H) \subset V$ is nonempty, open, and disjoint from $f(A)$, confirming that $f(A)$ is nowhere dense by characterisation (iii).
[/guided]
[/step]