How to prove that the set $A = \{\ q \in \mathbb{Q}\ |\ q = n + \frac{1}{2n} \mathrm{\ for\ }n\in\mathbb{N}\ \}$ is closed in $\mathbb{R}$? I am working in the metric space $\mathbb{R}$ equipped with the distance function $d(x,y)=|x-y|$.
Let $A = \{\ q \in \mathbb{Q}\ |\ q = n + \frac{1}{2n} \ \}$. How do I formally prove that $A$ is closed? In order to prove that $A$ is closed in $\mathbb{R}$ I need to show that $A=\mathrm{cl}(A)$. It is elementary that $A\subseteq\mathrm{cl}(A)$. So I just need to prove that $A\supseteq\mathrm{cl}(A)$
I have two definitions of $\mathrm{cl}(A)$:
DEFINITION 1:$\ $ $\mathrm{cl}(A)$ = { $b \in X$ | there exists a sequence $\{a_{n}\}_{n=1}^{\infty}\subset A$ such that $\lim\limits_{n \to \infty}=b$ }
DEFINITION 2:$\ $ $\mathrm{cl}(A)$ = { $b \in X$ | $B(b;r)\cap A \neq \emptyset$ for all $r>0$ }
I am confused as to how to prove $\mathrm{cl}(A) \subseteq A$ formally.
My ATTEMPT:
I think the second definition will be easier to use.
Let $b \in \mathrm{cl}(A)$. Then for any $r>0$ we have $B(b;r)\cap A \neq \emptyset$. Fix any $r>0$.
Since $B(b;r)\cap A$ is non-empty, take an element $p \in B(b;r)\cap A$. 
Since $p  \in A$, there exists an $n\in\mathbb{N}$ such that $p = n + \frac{1}{2n}$.
Since $p \in B(b;r)$, we have $|p-b|<r$, or equivalently, $|n+\frac{1}{2n}-b|<r$.
How do I show that this implies $b=m+\frac{1}{2m}$ for some $m\in \mathbb{N}$? This would show that $b\in A$, and hence $\mathrm{cl}(A) \subseteq A$.
Can someone help me out?
 A: $A$ is set of the solutions of the equation $$\sin\big(\pi \dfrac{x\pm\sqrt{x^2-2}}{2}\big)=0$$and so is the union of the zero sets of two continuous functions, hence closed.
A: Hint: we can choose an $r$ that lets us deduce that $n<p<n+1$.
A: One way to do this is to show that there exists some $\epsilon > 0$ such that
for any $m$ and $n$ one has
$$\bigg|n + {1 \over n} - \bigg(m + {1 \over m}\bigg)\bigg| > \epsilon \tag 1$$
For if this is true, the set $A$ can't have a limit point... if you had some sequence $\{x_n\}$ of points from $A$ converging to some $x$, then if $n$ is large enough $|x_n - x_{n+1}|$ would have to be less than $\epsilon$.
Showing $(1)$ reduces to some relatively easy algebra... for one has $$\bigg|n + {1 \over n} - \bigg(m + {1 \over m}\bigg)\bigg| = |n - m|\times \bigg|1 - {1 \over mn}\bigg|$$
A: Consider the function $f:(0,\infty)\to\mathbb R$ with $f(x)=x+\frac12x^{-1}$. This function is differentiable and $f'(x)=1-\frac12x^{-2}$. Note also that $f'(x) >0$ for $x\geq1$ because in that case $\frac12x^{-2}$ is at most $\frac12$. Thus $f$ is strictly increasing on $[1,\infty)$. In particular $f|_{\mathbb N}$ is strictly increasing, so $f(\mathbb N)$ can have at most one limit point. But it is easy to see that $f(n)\to\infty$, so $f(\mathbb N)$ has no limit point in $\mathbb R$ and is therefore closed (it contains all of its limit points, vacuously).
