[Math] To prove continuity using sequential definition of continuity

continuityreal-analysis

I have to show that the function

$$f(x) = \begin{cases}\;\; x &, \text{ if } x \text{ is rational} \\ – x &, \text{ if } x \text{ is irrational} \end{cases}$$

is continuous at $0$ and nowhere else.

ATTEMPT

I first consider a point which is not equal to $0$. Now there exists a sequence of irrationals (say $i_n$) which converge to $x_0\neq0$. $f(i_n)=-i_n$ which converges to $-x_0$. Thus violating definition of continuity. I am having doubt as to how to prove continuity at $0$ and about existence of such sequences of rationals and irrationals.

Thanks

Best Answer

For any real number $r$ there are a sequence $(r'_n)_{n\in\mathbb{N}}$ consisting of rational numbers and a sequence $(r''_n)_{n\in\mathbb{N}}$ consisting of irrational numbers such that $$ r=\lim_{n\to\infty}r'_n=\lim_{n\to\infty}r''_n $$ I'll prove this later. Now, let $r\ne0$; then $$ \lim_{n\to\infty}f(r'_n)=\lim_{n\to\infty}r'_n=r $$ whereas $$ \lim_{n\to\infty}f(r''_n)=\lim_{n\to\infty}-r''_n=-r $$ So the function $f$ is not continuous at $r$.

Suppose, instead, that $\lim_{n\to\infty}a_n=0$ (with no other hypothesis on the terms of the sequence. Then $\lim_{n\to\infty}|a_n|=0$ and, since $-|a_n|\le f(a_n)\le |a_n|$, the squeeze theorem tells you that $$ \lim_{n\to\infty}f(a_n)=0 $$ so the function $f$ is continuous at $0$.

How to define the two sequences? The key is that, given $a<b$, there are $c$ and $d$ such that

  1. $a<c<b$, $a<d<b$
  2. $c$ is rational
  3. $d$ is irrational

So, define $r'_n$ to be a rational number in the interval $(r,r+1/n)$ and $r''_n$ to be an irrational number in the interval $(r,r+1/n)$. The squeeze theorem says that $$ \lim_{n\to\infty}r'_n=r=\lim_{n\to\infty}r''_n $$

Related Question