Let $S,T \subseteq \mathbb{R}$ be given by $S= \{ x \in \mathbb {R} : 2 x^2 \cos\frac1x =1\}$ and $T= \{ x \in \mathbb {R} : 2 x^2 \cos\frac1x \leq1\} \cup \{0\}$ . Then ,under the usual metric on $\mathbb R$ , which one is complete?
My guess is both should be complete. As both sets are closed any cauchy sequence converges inside. But the answer given is only S. Am I making mistake?
As mentioned in the comments, closed subsets of complete metric spaces are complete, therefore it suffices to show that subsets are closed. Since continuous preimages of closed sets are closed, we know that $$S = f^{-1}(\{1\}), \ f(x) := 2x^2 \cos(1/x)$$ is complete. Can you apply a similar argument to $T$?