Answer
(a) Suppose that at a point $x=c$, $\lim_{x\to c}f(x)=L$ and prove that it contradicts the given fact using the formal definition of limit.
(b) $f$ cannot be left-continuous or right-continuous at any point.
Work Step by Step
$f(x)=1$ if $x$ is rational and $f(x)=0$ if $x$ is irrational.
(a) We would prove that as on $(-\infty,\infty)$, there is no value of $c$ for which $\lim_{x\to c}f(x)$ would exist.
Now suppose at a point $x=c$, $\lim_{x\to c}f(x)$ does exist and $\lim_{x\to c}f(x)=L$
According to formal definition of limit, this means that for an $\epsilon\gt0$, there exists a value of $\delta\gt0$ such that for all $x$:
$$0\lt|x-c|\lt\delta\Rightarrow|f(x)-L|\lt\epsilon$$
Now if we take a value of $\epsilon$ such that $0\lt\epsilon\lt|L|$, we still expect a corresponding value of $\delta\gt0$ such that for all $x$, the inequalities above still hold.
However, we know that $f(x)$ only has $2$ values: $0$ and $1$. Yet:
- If $f(x)=0$, then $|f(x)-L|=|0-L|=|-L|=|L|\gt\epsilon$
- If $f(x)=1$, then $|f(x)-L|=|1-L|$
So, for the inequality $|f(x)-L|\lt\epsilon$ to hold, $f(x)$ cannot equal $0$.
This means there must exist a value of $\delta\gt0$ building an interval $0\lt|x-c|\lt\delta$ for $x$, such that in this interval all $x$ are rational so that $f(x)=1$.
However, this contradicts the fact that EVERY nonempty interval of real numbers contains BOTH rational and irrational numbers.
Therefore, at no point on $(-\infty,\infty)$ can $\lim_{x\to c}f(x)$ exist, because if there is such a point, there must exist an interval which contains only rational numbers, and there is no such interval.
Since $\lim_{x\to c}f(x)$ does not exist at every point, $f$ is discontinuous at every point also.
(b) The proof in (a) also applies to left-side and right-side limit. The reason, again, is that if any of such limit exists, there must be an interval which contains only rational numbers, which contradicts our knowledge that every nonempty interval contains both rational and irrational numbers.
Therefore, $f$ cannot be left-continuous or right-continuous at any point.