Proving that $\mathbb{Q}$ is neither open or closed in $\mathbb{R}$

You are certainly right that all you need to show that $\mathbb{Q}$ is not open is to show that given a rational $q$, you can find irrationals arbitrarily closed to $q$. A very simple way of doing this is to take your favorite irrational, say $\sqrt{2}$, and then consider $\sqrt{2}/n$ with $n$ an integer. These numbers are never rational, and get arbitrarily small; so if $q$ is a given rational, then $q+\frac{\sqrt{2}}{n}$ will be as close as you want to $q$ by taking $n$ large enough.


There are many proofs of this.

NOT CLOSED:

  • The rationals are dense because the reals are the Cauchy completion of the rationals, so $\mathbb{Q}$ is not closed.
  • The rationals are dense because the reals are the Dedekind completion of the rationals, so ditto.
  • The decimal expansion of $\pi$ gives a sequence of rationals whose limit is not rational, so again it's not closed.
  • Any closed dense set contains a copy of the Cantor space, which has size continuum.

NOT OPEN:

  • Singletons are closed, so if the rationals were open, each set of the form $\mathbb{Q} \setminus \{ q \}$ would be open dense, so their intersection will be dense by Baire category, but their intersection is empty.
  • Open sets have positive measure, but the rationals have measure 0.
  • The irrationals are dense: If $q$ is some rational, then the irrational sequence $\pi ^{1/n}q$ tends to $q$. So does $q - \frac{\pi}{n}$. Dense sets must meet every open set but the rationals don't meet the irrationals, so the rationals aren't open.
  • Also since the irrationals are dense, they're not closed or else they would be all of $\mathbb{R}$. Hence their complement, the rationals, aren't open.