Intuition for dense sets. (Real analysis) I have been having problems with dense sets as my lecturer didn't really develop an intuition for dense sets in my class. So can any of you please help me with that? And can you please tell me (the general case) how I should go about proving that a set is dense in R.
 A: The prototypical example of a dense set is $\mathbb Q$ in $\mathbb R$. I can think of two ways of showing that a set $X$ is dense in $\mathbb R$:


*

*Show that it contains a subset $Y$ that is itself dense in $\mathbb R$.

*Show that every element of $\mathbb R$ is a limit of a sequence of elements in $X$. 


EDIT: As suggested by Henry,


*

*Given any two distinct elements in $\mathbb R$, there is an element of $X$ between them. 


Note that 1 applies to density in any topological space, 2 applies to any metric space, while 3 depends on the order of $\mathbb R$ is thus much less general.
A: A subset $A$ of ${\mathbb R}$ is dense in ${\mathbb R}$ if wherever you look in ${\mathbb R}$, you'll find an element of $A$ really close by. Formally, $A$ is dense means that every open interval $(a,b)$ of ${\mathbb R}$ contains an element of $A$. 
How to prove that a given set $A$ is dense in ${\mathbb R}$ heavily depends on what $A$ is, but a normal strategy would be to start with an open interval $(a,b)$ of ${\mathbb R}$ and somehow explicitly construct an element of $A$ that's in there.
A: A set $D$ is dense in $\Bbb R$ if every non-empty open interval of $\Bbb R$ contains a point of $D$; in symbols, $D$ is dense in $\Bbb R$ if and only if $D\cap(a,b)\ne\varnothing$ whenever $a,b\in\Bbb R$ and $a<b$. The set $\Bbb Q$ of rationals is dense in $\Bbb R$: if $a$ and $b$ are real numbers, and $a<b$, there is always a rational number between $a$ and $b$, so $\Bbb Q\cap(a,b)\ne\varnothing$. There is also always an irrational number between $a$ and $b$, so $\Bbb R\setminus\Bbb Q$, the set of irrationals, is also dense in $\Bbb R$. And of course $\Bbb R$ itself is dense in $\Bbb R$.
Another example of a dense subset of $\Bbb R$ is $\Bbb R\setminus\Bbb Z$, the set of real numbers that are not integers: you can easily prove that if $a<b$, the interval $(a,b)$ contains a non-integer. Similarly, $\Bbb R\setminus F$ is dense for any finite $F\subseteq\Bbb R$.
Here are a couple of less obvious examples. Let $$D=\left\{\frac{2m+1}{2^n}:n\in\Bbb N\text{ and }m\in\Bbb Z\right\}\;;$$ the elements of $D$ are the dyadic rationals, the rational numbers whose denominators in lowest terms are powers of $2$. This set $D$ is dense in $\Bbb R$; you might try to prove that $D\cap(a,b)\ne\varnothing$ whenever $a<b$. HINT: For a fixed $n$, the dyadic rationals with denominator $2^n$ are $\frac1{2^n}$ apart. Finally, let $C$ be the middle-thirds Cantor set; then $C$ does not contain any non-empty open interval, so $\Bbb R\setminus C$ intersects every non-empty open interval and is therefore dense in $\Bbb R$.
