Determining where a given function is continuous

61 Views Asked by At

An analysis book asks the following question:

Determine where the following function is continuous:

$$ f(x) = \left\{ \begin{array}{ll} x & \quad \text{if } x \text{ is rational} \\ \frac{1}{x} & \quad \text{if } x \text{ is irrational} \end{array} \right. $$

I claim that $f$ is discontinuous everywhere. For if $(x_n)$ is an irrational sequence converging to some $c \in \mathbb{Q}$ then $\lim f(x_n) = \lim \frac{1}{x_n} = 1/c \ne f(c)$ and similarly if $(x_n)$ is a rational sequence converging to some $c \in \mathbb{R} \setminus \mathbb{Q}$ then $\lim f(x_n) = \lim x_n = c \ne f(c)$.

Is my answer and justification correct?

Update : It looks as if $f$ is continuous at $\pm 1$. Here's my attempted proof of claim made:

Suppose $(x_n)$ be a real sequence converging to 1. Let $\varepsilon > 0$ be given.

Then there exists $N_1 \in \mathbb{N}$ such that $|x_n-1|< \varepsilon$ for all $n\ge N_1$.

Also there exists $N_2 \in \mathbb{N}$ such that $|x_n-1|< \varepsilon / 2 $ for all $n\ge N_2$.

And finally, there exists $N_3 \in \mathbb{N}$ such that $|x_n|\ge \frac{1}{2}$ for all $n\ge N_3$.

Let $N:=\max \{ N_1 , N_2, N_3 \}$. Now for all $n \ge N$ and $x_n \in \mathbb{Q}$, we have

$|f(x_n) - f(1)|= |x_n -1| < \varepsilon $

and for $x_n \in \mathbb{R} \setminus \mathbb{Q}$, we have

$|f(x_n) - f(1)| = |\frac{1}{x_n} -1| = \frac{|x_n -1|}{|x_n|} < 2 \cdot \frac{\varepsilon}{2} = \varepsilon$.

Similarly it can be done for $c=-1$.

Is this okay or is there any better way this can be done?

1

There are 1 best solutions below

0
On

For $x_0=1$ notice that $$|x-x_0|<\epsilon\to 1-\epsilon<x<1+\epsilon$$then we have $$\text{if }x\in\Bbb Q \to |x-1|<\epsilon\\\text{if }x\notin\Bbb Q \to 1-2\epsilon<\dfrac{1}{1+\epsilon}<\dfrac{1}{x}<\dfrac{1}{1-\epsilon}<1+2\epsilon$$where $\epsilon$ is small enough therefore $$|\dfrac{1}{x}-1|<2\epsilon$$and the function is continuous $x=1$ similarly $x=-1$