Metric Spaces - Open and Closed Subsets I am struggling with the following question:
Consider the metric space $\mathbb{Q}$ with metric $d$: $\mathbb{Q}\times \mathbb{Q} \mapsto \mathbb{R}$,  $d(x,y)=|x-y|$
What I want to do is show that there is a proper nonempty subset of $\mathbb{Q}$ that is both open and closed.
I've thought about this for a while and think it has something to do with the fact that the function maps rationals to reals, but I can't seem to figure it out. 
Any help is appreciated
 A: This answer is related to Gretsas's answer.
The set $A=(-\sqrt2, \sqrt2)\cap \mathbb{Q}$ is both closed and open in the given metric space $\mathbb{Q}$.
To show that $A$ is open, consider any point $q\in A$.  Let $r=\min( \sqrt2-q, q+\sqrt2)$.  The open ball $B(q, r)\subset A$, thus we have proven that every point in $A$ has an open neighborhood that is a subset of $A$.  By the definition of open sets in metric spaces, $A$ is open.
Now we will show that $A$ is closed.  Suppose that $x$ is a limit point of $A$.  By definition there exists a sequence $\{x_1, x_2, \ldots\}\subset A$ that converges to $x$.  But $|x_i|< \sqrt2$ for all positive integers $i$, so 
$$
|x| = \lim_{i\rightarrow \infty} |x_i| \leq \sqrt2.
$$
The fact that $x$ is rational implies that $|x|<\sqrt2$, hence $x$ is in $A$.  We have shown that all limit points of $A$ are in $A$, so $A$ is closed.
(Note: The proof above omits some technicalities that might not be apparent to an undergraduate.  In particular, I did not show why $B(q, r)\subset A$ and why $r>0$.  I also did not state why $x$ is rational, why $\lim_{i\rightarrow \infty} |x_i|$ exist, or even why the limit is equal to $|x|$.  If those statements are not immediately obvious to you, you should take some time to prove them. :) ) 
A: We have that:
$$\mathbb{Q}=[\mathbb{Q} \cap(-\infty,\sqrt{2})] \cup[\mathbb{Q} \cap(\sqrt{2}+\infty)]=A_1 \cup A_2$$
These two sets $A_1,A_2$ are disjoint and open in $(\mathbb{Q},|.|)$ with respect to the subspace topology on $\mathbb{Q}$ because $(-\infty,\sqrt{2}),(\sqrt{2},+\infty)$ are open in $(\mathbb{R},|.|)$
Thus $(\mathbb{Q},|.|)$ is a disconected metric space.
Thus exist an nonempty  proper subset subset of $\mathbb{Q}$  which is clopen in $(\mathbb{Q},|.|)$
Note that a metric(or topological in general) space is connected if and only if the only clopen sets in the space are the whole  space itself and $\emptyset$
