$X,Y$ be metric spaces , $f:X \to Y$ be a continuous and closed map , then the boundary of $f^{-1}(\{y\})$ is compact for every $y \in Y$ ? Let $X,Y$ be metric spaces , $f:X \to Y$ be a continuous and closed map , then is it true that the boundary of $f^{-1}(\{y\})$ is compact for every $y \in Y$ ? 
 A: The claim is true. A proof is reported by Theorem 1 in this paper by A. H. Stone (in case you’re wondering, this is not the Stone–Weierstrass-theorem guy), which I outline below.
Let $B$ denote the boundary of $f^{-1}(\{y\})$ and suppose, for the sake of contradiction, that it is not compact. Then, there exists a sequence $(x_n)_{n\in\mathbb N}$ in $B$ such that none of its subsequences converges to a limit in $B$. Note that $f^{-1}(\{y\})$ is closed because $f$ is continuous, so that $f(x_n)=y$ for each $n\in\mathbb N$.
Since $(x_n)_{\in\mathbb N}$ is in the boundary of $f^{-1}(\{y\})$ and $f$ is continuous, there exists a sequence $(w_n)_{n\in\mathbb N}$ in $X$ such that the following hold for each $n\in\mathbb N$:


*

*$(\spadesuit)\quad f(w_n)\neq y$;

*$(\heartsuit)\quad d_X(x_n,w_n)<1/n$;

*$(\clubsuit)\quad d_Y(f(x_n),f(w_n))=d_Y(y,f(w_n))<1/n$.


Let $W\equiv\{w_n\}_{n\in\mathbb N}$, the set consisting of the elements of the sequence $(w_n)_{n\in\mathbb N}$ (after suppressing repeated elements). I claim that $W$ is closed. Indeed, if $W$ is not closed, then there exists some $w\in X\setminus W$ and a sequence $(w_{n_k})_{k\in\mathbb N}$ in $W$ (which, as the notation suggests, can be regarded as a subsequence$^{\star}$ of $(w_n)_{n\in\mathbb N}$) such that $w_{n_k}\to w$. But then ($\heartsuit$) implies that $x_{n_k}\to w$ (and $w\in B$ since $B$ is closed), contradicting the assumption that $(x_n)_{n\in\mathbb N}$ has no convergent subsequence.
Therefore, $W$ must be closed, and since $f$ is a closed map, $f(W)$ is closed, too. But note that ($\spadesuit$) yields that $y\notin f(W)$, whereas ($\clubsuit$) yields that $y\in\operatorname{cl}f(W)=f(W)$, which is a contradiction.

$^{\star}$Remark: Note that it is not true that any sequence consisting of the members of $W$ is automatically a subsequence of $(w_n)_{n\in\mathbb N}$, as a subsequence must also obey a certain order structure inherited from the parent sequence. In the argument above, the assumption that $w\notin W$ is needed in a subtle way to establish that $(w_{n_k})_{k\in\mathbb N}$ can be regarded as a bona fide subsequence of $(w_n)_{n\in\mathbb N}$. I leave it to the Reader to figure out the details.
