Question about the density of Q in R So I was looking over a density that shows that the rational numbers are dense in the real numbers. If $0< a <b$, with with $a,b$ real numbers, then I understood why we can chose n such that:
$$ \frac{1}{n} < a- b $$
and m such that:
$$ m-1 \leq an < m $$
The reasons are pretty easy, so I won't state them because they're not bothering me at all, my question isn't about them. So, by choosing $m,n$ integers, that satisfy the two inequalites we can show that:
$$ a < \frac{m}{n} < b$$
Which proves that we can find a rational numbers between any two reals. Then we can prove the case where $ a < 0 $ 
My question is, how does one get the idea to choose the n and m that satisfy the above properties? How does one get the intuition necessary for this kind of proof? After we fixed $n,m$,  the algebra it's pretty easy and it leads us easily to the conclusion. But again, how can you get such an inspiration for chosing $n,m$? I agree that with enough will and guesswork you can find them. But is there some more subtle reason that can lead us to this idea? Am I missing something?
 A: The idea (assuming that $a > 0$) is to look at the sequence of fractions $\dfrac 1n, \dfrac 2n, \dfrac 3n, \dfrac 4n,\cdots$ and to try to show that at least one of  these values lies in between $a$ and $b$. The problem is that if $a$ and $b$ are too close together, then both $a$ and $b$ could lie in between two adjacent terms of the sequence.  However, if $\dfrac 1n$ is small enough (less than $b-a$) this can't happen--that is, if $\dfrac{m-1}{n} \le a$ but $\dfrac mn > a$, then in fact $\dfrac mn < b$.
A: I'm interpreting your question as "how does a mathematician find such a proof", and not as "how does this specific proof work intuitively". I think a good approach to solve this, if you don't have any idea, is backwards. Let me try to give the way I would have approached the problem:
Obviously, given $a,b\in \mathbb{R}$ we want to find $\frac m n \in \mathbb{Q}$ with
$$a < \frac{m}{n} < b$$
Now we experiment a bit. In a way there are three possibilities open to us:


*

*first find m, then fix m and find n

*first find n, then fix n and find m

*somehow find both of them at the same time


Approach number 3 looks more complicated, so we should look at the other two approaches first. Approach number 1 to me looks kind of odd, I wouldn't even know where to start looking so I'm trying to do approach number 2 (There may be a certain amount of dead end tries here, but I will ommit them):
Now I proceed again backwards. Assuming that I already have n, then m is my unknown and I should try to reformulate the problem into
$$an < m < bn$$
so the unknown stands alone. Now the first part of this inequality is easy, I have a fixed number $an$ so I just need to pick $m$ as the next integer. But I have to start thinking, what about $m < bn$? I need to make sure that there actually is an integer between $an$ and $bn$. But I still haven't chosen $n$, so what about that?
I know there will be an integer between $an$ and $bn$ if $an + 1 < bn$. But then I can solve for $n$ and write
$$ 1 < bn - an \Leftrightarrow \frac{1}{n} < b-a$$
and I know that such an $n$ indeed exists.
Now all I need to do is to write down this argument the other way round and end up with a proof.
There is one thing you should always keep in mind about mathematics: Proofs are seldom written down in the same way as they actually were developed. In the beginning you know roughly where to start (many of the conditions for a theorem actually are just put there when you see that you need them in the proof) and you know where you want to end up. From this you usually work in all directions forwards and backwards, sometimes establishing some points in the middle or splitting the result in smaller parts you think are easier, slowly closing the gaps. Then, when you are finished you have something that is rather unreadable, so you put it in the right order, remove some of the rubbish parts you never needed and try to write it down precisely. 
Many mathematicians are able to write down smaller proofs they just thought of in the correct order directly, but they will just have done the same back and forth in their mind, at least that's how I usually do this. However note, that there is no magic proof strategy that will always give you a result, just a bag of tricks you know and years of training and the intuition devolped from this training. There may be some savants, who just see the result, but they really are an exception.
A: This answer is not as elegant as the others, but I am posting this here for myself. This is how you might have solved the question pre-draft if it were on a timed exam. By the Archimedean Property, we may have also first chosen the smallest integer $m$ such that $na \lt m$, and only then justified a choice for $n$ upon examination of the inequality $m \lt na + 1$. That $a \lt b - \frac{1}{n}$ (not "equals to", lest we contradict that $a \lt b$) follows naturally from seeking simple cancellation without regard to a geometric construction like presented in Understanding Analysis, Stephen Abbott, and anyways it is also justified by the Archimedean Property.
