# Prove that if B is closed and nowhere dense, $f^{-1}(B)$ is also closed and nowhere dense.

Let $f: \mathbb R \rightarrow \mathbb R$ be a continuous function that is nonconstant on any interval. Prove that if B is closed and nowhere dense, $f^{-1}(B)$ is also closed and nowhere dense. My proof: Since $B$ is nowhere dense, $B = \cup^{\infty}_{i=1}F_i$ where each $F_i$ is nowhere dense in $\mathbb R$, then $cl(F_i)$ contains no nonempty open set, and $cl(F_i)$ is also nowhere dense. Then we can use the property of continuous function to say that the preimage is also closed. But I don't know how to prove the preimage is nowhere dense.

• You haven't used the fact that $f$ is nonconstant on all intervals. – user99914 Nov 8 '15 at 8:58
Heuristically, if $f^{-1}(B)$ weren't nowhere dense, then we would have a limit point (point of denseness) in the preimage. Go ahead and think of this as an interval. But then if $f$ is nonconstant on that interval, so it would map to an interval in the image, contradicting the assumption that $B$ is first category. This isn't exactly what's going on, but it's a cartoon of it.
Making this rigorous: Write $G$ for the complement of $B$. Then $f^{-1}(G)$ is an open set. This open set is dense, since for any $x\in\mathbb{R}$, $\epsilon >0$, if we assume $$(x-\epsilon,x+\epsilon) \cap G = \emptyset ~~~ \text{ then we get } ~~~ f(x-\epsilon, x+\epsilon) \subset B,$$ but $f$ is nonconstant on this interval, and so the image $f(x-\epsilon, x+\epsilon)$ contains (using the intermediate value theorem) an interval of positive length. This is impossible by assumption.
• Wy $G_i$? There is only one complement. $B$ is closed and nowhere dense already so we can apply your argument directly to it; the F_i$are not needed, I think. It seems like the OP wanted to use first category sets maybe? Also Baire is then not needed. – Henno Brandsma Nov 8 '15 at 12:17 • @HennoBrandsma Agreed, good point. I'll edit. To be clear for OP, the original argument is only necessary if we relax$B\$ to a first category set. – Titus Nov 8 '15 at 23:09