limits involving a piecewise function, Prove that if $c \ne 2$, then f does not have a limit at $x = c$. $$f(x) = \begin{cases} (x-2)^3 & \text{if $x$ is rational }  \\
(2-x) & \text{if $x$ is irrational }
\end{cases}$$
(i) Prove that if $c \ne 2$, then f does not have a limit at $x = c$.
(ii) Prove that $\lim_{x\to2} f (x)$ exists.
Hi all, i'm not very sure how to approach this question. For part i), i think i'm suppose to find a rational sequence $x_n$ and an irrational sequence $y_n$ such that $x_n \rightarrow c$ & $y_n\rightarrow c$. But $\lim_{n\to \infty}f(x_n) \ne \lim_{n\to \infty}f(y_n)$. Would letting $x_n = \frac{1}{n}$ and $y_n=\frac{1}{\sqrt{n}}$ suffice?
I'm clueless as to how to answer part ii). Would appreciate any hints or advice. Thanks in advance.

Since the rationals are dense in $\mathbb{R}$, for every $c\in\mathbb{R}$ there is a sequence $\{x_n\}$ of rationals which converges to $c$. Then the sequence $\{f(x_n)\}$ converges to $(c-2)^3$. Furthermore, since the irrationals are dense in $\mathbb{R}$, for every $c\in\mathbb{R}$ there is a sequence $\{y_n\}$ of irrationals which converges to $c$. Then the sequence $\{f(y_n)\}$ converges to $2-c$. Thus, the function can have a limit only where $(c-2)^3=2-c$, that is, at $c=2$.
To determine whether $f(x)$ has a limit at $x=2$, let $\epsilon>0$ and put $\delta=min\{\epsilon,\epsilon^{1/3}\}$. Let $x\in\mathbb{R}$  such that $|x-2|<\delta$. If x is rational, then $|f(x) - f(2)|=|(x-2)^3|<\delta^3$. If x is irrational, then $|f(x) - f(2)|=|2-x|<\delta$. In either case, $|f(x) - f(2)|<\epsilon$. $\ \ \ \ \Box$
