I've noticed that most proofs of the density of $\mathbb Q$ in $\mathbb R$ use the Archimedean principle. For example see @Arturo Magidin's checked answer here. Density of irrationals
I'm puzzled by the fact that in the hyperreals, the standard rationals must be dense in the standard reals; yet the hyperreals are not Archimedean. This would seem to imply that the Archimedean principle is not a necessary assumption.
I can see that in the hyperreals, if $\epsilon$ is infinitesimal then there is no standard rational between $\epsilon$ and $2 \epsilon$; so that the standard rationals are not dense in the hyperreals.
But now I'm confused. Wouldn't the hyper-rationals be dense in the hyperreals? And wouldn't it still be a theorem that the standard rationals are dense in the standard reals?
Clearly the answer must be in some subtlety involving standard/nonstandard reals and the transfer principle. Can anyone shed any light? Is the Archimedean principle necessary to prove that the rationals are dense in the reals? Why aren't the hyperreals a counterexample?
I am not completely sure about the question, but I think this may be the answer.
When we construct the reals directly from the rationals, for example using Dedekind cuts or Cauchy sequences, we can directly prove the rationals are dense in the reals using the construction. Thus we can prove that the reals have the Archimedean property, we don't just assume they have the property.
However, sometimes authors want to avoid the details of this construction. They want to talk about the rationals and the reals, and the relationship between them, without having to talk about Dedekind cuts or anything like that. This way, they can move on to other topics more quickly - the constructions can be difficult for less experienced students. So, rather than constructing the reals from first principles, an author may present a list of axioms for the reals, so that those axioms are enough to obtain the results the author is interested in.
In these cases, it is common to use the Archimedean property itself as an axiom. This allows us to prove that the sequence $(1/n)$ converges to $0$, and other key facts about the topology of the reals, without referring to any specific construction of the reals.
Not every field is Archimedean, though. For example, the hyperreals are not Archimedean, as the question points out. There is no contradiction to this - when we actually construct the hyperreals we can't prove they are Archimedean (because they aren't), unlike when we construct the ordinary reals.
The same idea about replacing constructions with axioms applies to the hyperreals - some authors in nonstandard analysis give direct constructions of the hyperreals, while others only give a list of axioms for the hyperreals, which are enough to prove the results the authors are interested in obtaining.