Good night, I'm trying to prove this theorem:
Let $B = \{-n +(1/n) \mid n = 2,3,4,\ldots \}$. Prove that $B$ is closed in $\mathbb R$.
My attempt:
Let $A = \{2,3,4,\ldots\}$. I claim that $A$ is closed in $\mathbb R$. If not, there is a sequence $(a_n)$ in $A$ such that $a_n \to a \notin A$. Clearly, $a \ge 2$. It follows that $n < a < n+1$ for some $n \in A$. Let $\epsilon = \min\{(n+1)-a, a-n\}$. Then there is $a_N \in (a-\epsilon,a+\epsilon)$, so $a_N$ is not an integer. This contradicts the fact that $a_N \in A$.
Consider $f: B \to A, \quad -n +(1/n) \mapsto n$. Next we prove that $f$ is continuous. Given $\delta >0$, if $|[-n +(1/n)] - [-m +(1/m)]| < \delta$ then $|(m-n)[1+1/(mn)]| < \delta$ and thus $|m-n| < \delta$. Hence $f$ is continuous. Since $A$ is closed in $\mathbb R$, $f^{-1}[A] = B$ is closed in $\mathbb R$.
My questions:
Could you please verify if my proof looks fine or contains logical gaps/errors?
If possible, I would like to ask for more direct or alternative proofs.
Thank you so much ^o^
Another possible approach for 2): $|(-n+\frac 1 n)-(-m+\frac 1 m)| \geq |n-m| -|\frac 1 n -\frac 1 m| \geq 1-\frac 1 2 =\frac 1 2$ whenever $n \neq m$. So any convergent sequence in $B$ is eventually constant which implies that the limit belongs to $B$.