Showing that a pathological function is only continuous at 0

Mr Davis 97
Messages
1,461
Reaction score
44

Homework Statement


Let ##f## be defined on ##[0,1]## by the formula
$$ f(x) = \left\{
\begin{array}{ll}
x & \text{if } x \text{ is rational} \\
0 & \text{if } x \text{ is irrational} \\
\end{array}
\right. $$
Prove that ##f## is continuous only at ##0##.

Homework Equations

The Attempt at a Solution


First I will try to prove that ##f## is continuous at ##0##. We will show that for every sequence ##\{a_n\}## such that ##\lim_{n\to\infty}a_n = a## we have ##\lim_{n\to\infty}f(a_n) = f(a)##. To this end let ##\{a_n\}## be a sequence such that ##\lim_{n\to\infty} a_n = 0##. Let ##\epsilon > 0##. By the fact that ##\{a_n\}## converges to ##0## we have that there exists ##N\in \mathbb{N}## such that ##n\ge N## implies ##a_n < \epsilon##. Now, suppose that ##a_n## is rational, then ##|f(a_n)-0| = f(a_n) = a_n < \epsilon##; suppose that ##a_n## is irrational, then ##|f(a_n)-0| = 0 < \epsilon##. So we have shown that if ##n\ge N##, then ##|f(a_n) - 0| < \epsilon##, and so ##\lim_{n\to\infty}f(a_n) = 0 = f(0)##. Hence ##f## is continuous at ##0##.

Second we will show that for all ##a\in(0,1]##, ##f## is not continuous. Let ##a\in(0,1]##. Note that by the density of rational and irrationals there exists a rational sequence ##r_n## and an irrational sequence ##i_n## such that ##\lim_{n\to\infty}r_n = \lim_{n\to\infty}i_n = a##. However, we see that ##\lim_{n\to\infty}f(r_n) = \lim_{n\to\infty} r_n = a \not = 0 = \lim_{n\to\infty}f(i_n)##. If ##f## were continuous these limits would be the same, and so we have that ##f## is not continuous on the interval ##(0,1]##.
 
  • Like
Likes WWGD and Delta2
Physics news on Phys.org
Mr Davis 97 said:

Homework Statement


Let ##f## be defined on ##[0,1]## by the formula
$$ f(x) = \left\{
\begin{array}{ll}
x & \text{if } x \text{ is rational} \\
0 & \text{if } x \text{ is irrational} \\
\end{array}
\right. $$
Prove that ##f## is continuous only at ##0##.

Homework Equations

The Attempt at a Solution


First I will try to prove that ##f## is continuous at ##0##. We will show that for every sequence ##\{a_n\}## such that ##\lim_{n\to\infty}a_n = a## we have ##\lim_{n\to\infty}f(a_n) = f(a)##. To this end let ##\{a_n\}## be a sequence such that ##\lim_{n\to\infty} a_n = 0##. Let ##\epsilon > 0##. By the fact that ##\{a_n\}## converges to ##0## we have that there exists ##N\in \mathbb{N}## such that ##n\ge N## implies ##a_n < \epsilon##. Now, suppose that ##a_n## is rational, then ##|f(a_n)-0| = f(a_n) = a_n < \epsilon##; suppose that ##a_n## is irrational, then ##|f(a_n)-0| = 0 < \epsilon##. So we have shown that if ##n\ge N##, then ##|f(a_n) - 0| < \epsilon##, and so ##\lim_{n\to\infty}f(a_n) = 0 = f(0)##. Hence ##f## is continuous at ##0##.

Second we will show that for all ##a\in(0,1]##, ##f## is not continuous. Let ##a\in(0,1]##. Note that by the density of rational and irrationals there exists a rational sequence ##r_n## and an irrational sequence ##i_n## such that ##\lim_{n\to\infty}r_n = \lim_{n\to\infty}i_n = a##. However, we see that ##\lim_{n\to\infty}f(r_n) = \lim_{n\to\infty} r_n = a \not = 0 = \lim_{n\to\infty}f(i_n)##. If ##f## were continuous these limits would be the same, and so we have that ##f## is not continuous on the interval ##(0,1]##.

Completely correct. No remark to be made.
 
  • Like
Likes Mr Davis 97 and Delta2
I agree its completely correct, however i have one remark (or you can say demand) to be made.

For the purpose of this proof is enough to say that the above sequences ##r_n## and ##i_n## exist ( as a consequence that rationals and irrational are dense in ##\mathbb{R}##), however if we want to be "constructive", how can we construct specific ##r_n## and ##i_n## (i mean to explicitly give the formula for ##r_n## or ##i_n##). The interesting cases are
1) when ##a\in[0,1]## is irrational, what specific rational sequence ##r_n\rightarrow a## can we find
2) when ##a\in[0,1]## is rational , what specific ##i_n\rightarrow a## can we find.
 
Delta2 said:
I agree its completely correct, however i have one remark (or you can say demand) to be made.

For the purpose of this proof is enough to say that the above sequences ##r_n## and ##i_n## exist ( as a consequence that rationals and irrational are dense in ##\mathbb{R}##), however if we want to be "constructive", how can we construct specific ##r_n## and ##i_n## (i mean to explicitly give the formula for ##r_n## or ##i_n##). The interesting cases are
1) when ##a\in[0,1]## is irrational, what specific rational sequence ##r_n\rightarrow a## can we find
2) when ##a\in[0,1]## is rational , what specific ##i_n\rightarrow a## can we find.

For example, when a is irrational. Then ##a-1/n## is a sequence of irrationals convering to ##a## (for n large enough such that this sequence lies in tbe interval).

The crux is of course to show that every irrational can be approximated by rationals.

For this, you can take the decimal expansion of a and define a sequence converging to a by always taking one digit more in the decimal expansion. This is an explicit construction, but requires that you know the decimal expansion. I think decimal expansion existence may depend on denseness so this might be a circle reasoning.
 
  • Like
Likes Delta2
This can be done without using sequences.

Let \epsilon &gt;0 and |x| &lt; \epsilon. Then either x is irrational, in which case f(x) - f(0) = 0 - 0 = 0 &lt; \epsilon, or x is rational, in which case |f(x) - f(0)| = |x| &lt; \epsilon. Thus f is continuous at zero.

Let a \neq 0 and \delta &gt; 0. Let x be irrational such that |x - a| &lt; \delta. Then <br /> |f(x) - f(a)| = |a| &gt; \frac12|a|. Thus f is not continuous at a.
 
  • Like
Likes WWGD
Math_QED said:
Completely correct. No remark to be made.
Delta2 said:
I agree its completely correct
Hi Math and Delta2:
I think I have misunderstood something.
https://en.wikipedia.org/wiki/Continuous_function#Definition_in_terms_of_limits_of_functions
The function f is continuous at some point c of its domain if the limit of f(x), as x approaches c through the domain of f, exists and is equal to f(c).[8] In mathematical notation, this is written
4ddaac6516cb3ef4538eeaca443e287c8551ac9e
In detail this means three conditions.
First, f has to be defined at c (guaranteed by the requirement that c is in the domain of f).
Second, the limit on the left hand side of that equation has to exist.
Third, the value of this limit must equal f(c).​
(We have here assumed that the domain of f does not have any isolated points. For example, an interval or union of intervals has no isolated points.)
As I understand the above the proof is incomplete. It is not sufficient to establish the limit of f(x) in terms of an x sequence limited to a restricted set of values an. I think the above Wikipedia definition implies that it necessary to show that you get convergence for an arbitrary sequence involving both rationals and irrationals. Am I wrong about this?

What comes to my mind is a related question. Does f'(x)=df(x)/dx have a value for x=0? I think the answer is "no", but if you choose values of x=an where these values are all rational, you will get the answer "yes" (f'(0)=1), or if you choose only irrational values, you will also get "yes" (f'(0)=0).

Regards,
Buzz
 
Buzz Bloom said:
Hi Math and Delta2:

As I understand the above the proof is incomplete. It is not sufficient to establish the limit of f(x) in terms of an x sequence limited to a restricted set of values an. I think the above Wikipedia definition implies that it necessary to show that you get convergence for an arbitrary sequence involving both rationals and irrationals. Am I wrong about this?Regards,
Buzz
Hi @Buzz Bloom
I think you have misinterpret the text of the proof. The sequence ##a_n## there, is a sequence that involves both rationals and irrationals. We just take cases and when we say "if ##a_n## is rational" we mean if it is rational for a specific ##n## (not for all ##n##) and similarly when we say "if ##a_n## is irrational".
Maybe the complete proof that says this explicitly will be something like "suppose ##k,n>N## such that ##a_k## is rational and ##a_n## is irrational. We know that ##a_k<\epsilon , a_n<\epsilon## " and then show that ##|f(a_k)-0|<\epsilon## and ##|f(a_n)-0|<\epsilon##.

But i don't think its necessary to do this, the way the proof is written is enough for me.
 
Last edited:
  • Like
Likes Buzz Bloom and member 587159
Buzz Bloom said:
Hi Math and Delta2:
I think I have misunderstood something.
https://en.wikipedia.org/wiki/Continuous_function#Definition_in_terms_of_limits_of_functions
The function f is continuous at some point c of its domain if the limit of f(x), as x approaches c through the domain of f, exists and is equal to f(c).[8] In mathematical notation, this is written
4ddaac6516cb3ef4538eeaca443e287c8551ac9e
In detail this means three conditions.
First, f has to be defined at c (guaranteed by the requirement that c is in the domain of f).
Second, the limit on the left hand side of that equation has to exist.
Third, the value of this limit must equal f(c).​
(We have here assumed that the domain of f does not have any isolated points. For example, an interval or union of intervals has no isolated points.)​
As I understand the above the proof is incomplete. It is not sufficient to establish the limit of f(x) in terms of an x sequence limited to a restricted set of values an. I think the above Wikipedia definition implies that it necessary to show that you get convergence for an arbitrary sequence involving both rationals and irrationals. Am I wrong about this?

What comes to my mind is a related question. Does f'(x)=df(x)/dx have a value for x=0? I think the answer is "no", but if you choose values of x=an where these values are all rational, you will get the answer "yes" (f'(0)=1), or if you choose only irrational values, you will also get "yes" (f'(0)=0).

Regards,
Buzz

@Delta2 pointed out why the proof above is correct.

Now you are asking that ##f'(0)## exists for this function, or in other words, if ##\lim_{x \to 0} \frac{f(x)}{x}## exists.

It doesn't exist: consider the sequence ##(1/n)## which converges to 0 from the right. Then ##f(1/n)/(1/n) = nf(1/n) = 1## converges to ##1##.

On the other hand, consider the sequence ##(\sqrt{2}/(2n))## which is a sequence of irrationals in the interval converging to ##0##. Then ##f(\sqrt{2}/(2n))/(\sqrt{2}/(2n)) = 0 ## converges to ##0## (again trivially) and the limit cannot exist.
 
  • Like
Likes Buzz Bloom and Delta2
Back
Top