0

I had this homework problem:

If $f(x)$ is continuous in $[0,1]$ and $f(x)=1$ for all rational numbers in $[0,1]$, then $f(\frac{1}{\sqrt{2}})$ is equal to $1$.

My logic for marking it false was that there are infinite irrational numbers for each rational number, so the immediate neighbourhood of an irrational number must also be irrational. Since the immediate neighbourhood is not rational, it doesn't have to necessarily be equal to 1, but the given answer was true.

My teacher said that we can't be sure if the immediate neighbourhood of $\frac{1}{\sqrt{2}}$ is irrational or rational, so $f(x)$ will be $1$ for irrational numbers as well.

Are any of us two correct?

  • Welcome to MSE. What is “the immediate neighbourhood of $\frac1{\sqrt2}$”? – José Carlos Santos May 07 '22 at 18:28
  • 1
    What does it mean for a neighborhood to be "irrational"? – lulu May 07 '22 at 18:30
  • @JoséCarlosSantos I believe it's the value of $x$ infinitely close to $x$ (from both sides) but not exactly $x$ – Abhyudit Singh May 07 '22 at 18:32
  • 1
    There is no notion of "infinitely close". there are limits, of course, but two distinct real numbers $a,b$ can not be "infinitely close". – lulu May 07 '22 at 18:33
  • And related, there is no smallest neighborhood around a point. Any neighborhood you might look at, there are even smaller ones. – aschepler May 07 '22 at 18:34
  • After reading the comments and the answer, I realise that we may have been twisting the meanings of some words in my classes. Feel free to edit the question with better wording if someone understands what exactly my doubt was. – Abhyudit Singh May 07 '22 at 18:42

1 Answers1

1

Every neighborhood in $\mathbb{R}$ (at least, using the standard topology) contains infinitely many rational numbers AND infinitely many irrational numbers. There is no such thing as a "rational neighborhood" or "irrational neighborhood".

For this problem, since every neighborhood of $1/\sqrt{2}$ contains rational numbers and therefore values where $f(x) = 1$, and $f$ is continuous, it must be the case that $f(1/\sqrt{2}) = 1$ (in fact, $f(x)=1$ everywhere in the interval $[0,1]$).

aschepler
  • 9,449
  • But if the set of irrational numbers is larger than the set of rational numbers, then wouldn't that mean that I should find another irrational number right beside $\frac{1}{\sqrt{2}}$? – Abhyudit Singh May 07 '22 at 18:39
  • There is no number "right beside" it. If $x = \frac{1}{\sqrt{2}}$ and $y \neq x$ is any other real number at all, there are infinitely many real numbers (including rationals and irrationals) between $x$ and $y$. – aschepler May 07 '22 at 18:43
  • By my above comment, I meant to ask: if there are infinite rational numbers between two integers, say, 1 and 2, then can we say something similar for rational numbers and irrational numbers? – Abhyudit Singh May 07 '22 at 18:45
  • 1
    Sure, there are infinite irrational numbers between any two rational numbers. And also infinite rational numbers between those two rational numbers. And infinite rational numbers between any two irrational numbers. The real numbers are not a sequence, where you can find the "next" number after another number. – aschepler May 07 '22 at 18:48
  • Between any two numbers, not just between integers, there are infinitely many rational numbers and infinitely many irrationals. There are more irrationals (uncountably many) but the rationals are still "dense" on the number line, which means no matter how close you zoom in on the line you still have rationals between any two points. – David K May 07 '22 at 18:49
  • 'The real numbers are not a sequence, where you can find the "next" number after another number.' Ah, after reading this I understand your answer. There is no "next" real number after/before $\frac{1}{\sqrt{2}}$ so my logic of saying that there would be infinite irrational numbers between 2 rational numbers with an "infinitely small difference" is wrong since there is no "infinitely small difference". – Abhyudit Singh May 07 '22 at 18:54
  • @DavidK What I mean in that comment was if we take the set of integers and the set of rational numbers, then between 2 adjacent elements of the set of integers, there will be infinite rational numbers. Now I understand that we can't say the same about the set of rational numbers and the set of irrational numbers since there is no such thing as an adjacent element in the set of rational numbers. – Abhyudit Singh May 07 '22 at 18:57
  • @AbhyuditSingh, Let's play a game. We each choose a rational number bigger than $1/\sqrt 2$. Whoever chooses the smaller number wins. Would you like to start? – Ruy May 07 '22 at 19:39