Let $X$ denote a metric space.
Whenever $S \subseteq X$ and $r \in \mathbb{R}_{\geq 0}$, write $f(S,r)$ for the following set.
$$\{x \in X \mid \exists s \in S : d(x,s) \leq r\}$$
Question. Given a closed set $S \subseteq X$ and any $r \in \mathbb{R}_{\geq 0}$, does it follow that $f(S,r)$ is closed?
If not, a counterexample $(X,S,r)$ would be appreciated.
The answer is no.
Let $S=\{1-\frac{1}{n}\}_{n=1}^\infty$. Let $X$ be the set $S\cup [1.5,2]$ with its subspace metric. Then $f(S,1)=S\cup [1.5,2)$ is not closed in $X$ since it is not of the form $C\cap X$ for some closed set $C$ of the reals.
We indeed see that $S$ is not a compact subset of $X$, in align with William's result.