Suppose I have a function $f$ given by:
$f(x)=1$ if $x \in \mathbb{Q}$ and $f(x)=1+\frac{1}{x}$ if $x \notin \mathbb{Q}$.
How would I go about seeing what the function looks like?
I have been thinking that there are infinitely many numbers both in the rational numbers and not in the rational numbers for any interval in $\mathbb{R}$ so I'm not sure exactly what it would look like.
I suspect for large $x$ it is pretty much like the line $x=1$ but for small values I'm having trouble visualising it.
What this function "looks like" is more a philosophical than a mathematical question. Since the graphs of both cases $f(x)=1$ ($x\in\mathbb{Q}$) and $f(x)=1+\frac{1}{x}$ ($x\in\mathbb{R}\setminus\mathbb{Q}$) lie dense in the graphs of the functions $f(x)=1$ ($x\in\mathbb{R}$) and $f(x)=1+\frac{1}{x}$ ($x\in\mathbb{R}$) respectively I guess the best way to visualize it is by having both of the latter graphs in one plot.