Let $f(x)=|x|$ for $x\in\mathbb{Q}$ and $f(x)=1$ for $x\in\mathbb{R}/\mathbb{Q}$, where $\mathbb{Q}$ is the set of rationals. (a) Show $f$ has limits at $1$ and $-1$. Find them. (b) Show that if $c\not=1$ or $c\not=-1$, then $f$ doesn't have a limit at $c$.
Attempt:
(a) Since $f(x)$ is either $|x|$ or $1$, we have $|f(x)|\leq|x|$ $\forall x\in\mathbb{R}$. Let $\epsilon>0$, $\delta(\epsilon)>0$.
I don't know what $\delta(\epsilon)>0$ should be. But from there I think a basic outline would be something like:
Then it follows that $1<|x|<\delta$, then $|f(x)|<\epsilon$. So $\lim\limits_{x\to0}f(x)=1.
But I'm not sure.
Any help/hints would be greatly appreciated.
(b) Suppose $c\not=1$. Let $(x_n)$ be a sequence of rationals converging to $c$. Let $(y_n)$ be a sequence of irrationals converging to $c$. These sequences exist because both $\mathbb{Q}$ and $\mathbb{R}/\mathbb{Q}$ are dense in $\mathbb{R}$. Then $$\lim\limits_{n\to\infty}f(x_n)=\lim\limits_{n\to\infty}x_n=c\not=1=\lim\limits_{n\to\infty}1=\lim\limits_{n\to\infty}f(y_n).$$ By the Sequential Criterion, $f$ does not have a limit at $c\not=1$.
For $c\not=-1$, I don't know if I can use the same method.
Any help/hints would be greatly appreciated.