Is the set of irrationals separable as a subspace of the real line?

$\Bbb R$ is second countable (i.e., has a countable base), so it’s hereditarily separable. Specifically, let $\mathscr{B}$ be the set of all open intervals with rational endpoints; $\Bbb Q$ is countable, so $\mathscr{B}$ is countable. Enumerate $\mathscr{B}=\{B_n:n\in\Bbb N\}$, and for $n\in\Bbb N$ let $x_n$ be any irrational number in $B_n$. Then $\{x_n:n\in\Bbb N\}$ is a countable dense subset of $\Bbb R\setminus\Bbb Q$. (Clearly the same trick works for any subset of $\Bbb R$, not just the irrationals.)

For an explicit example of such a set, let $\alpha$ be any irrational; then $\{p+\alpha:p\in\Bbb Q\}$ is a countable dense subset of $\Bbb R\setminus\Bbb Q$.

There are many separable Hausdorff spaces with non-separable subspaces. Two are mentioned in this answer to an earlier question. The first is compact; the second is Tikhonov and pseudocompact. Both are therefore quite nice spaces. Both are a bit complicated, however. A simpler example is the Sorgenfrey plane $\Bbb S$: $\Bbb Q\times\Bbb Q$ is a countable dense subset of $\Bbb S$, and $\{\langle x,-x\rangle:x\in\Bbb R\}$ is an uncountable discrete subset of $\Bbb S$ (which is obviously not separable as a subspace of $\Bbb S$).


Every subspace of a separable metric space is separable.

For the irrationals, take the irrational algebraic numbers, those are dense in $\mathbb R$ and therefore in the irrationals too. As Jacob remarks below, if $\alpha$ is irrational, then $\{\alpha+q\mid q\in\mathbb Q\}$ is also dense.

Generally speaking, the irrationals are homeomorphic to the Baire space, the set of sequences of natural numbers, equipped with the product topology $\mathbb N^\mathbb N$.

This has a countable dense subset: eventually constant sequences.