Why is this function periodic?

66 Views Asked by At

f(x) = {1 if x is rational, 0 if x is irrational}

Why is this function periodic? I tried the following to prove it but couldn't find it satisfying.

What I did was assume that f(x+T) = f(x), with T a rational number. Now if x is irrational, then x+T would also be irrational. And if x is irrational, then x+T would be irrational, hence proving the function as periodic.

But this I feel is wrong way to approach it, since we're already assuming T as a rational number, even though it might be irrational too. And we can't assume something we're gonna prove, in the first place.

Please tell how I can prove it as a periodic function. Thanks! (sorry I do not know LaTeX).

I have looked at this answer already, but couldn't find a satisfactory answer.

1

There are 1 best solutions below

4
On BEST ANSWER

Since Rational+Rational=Rational and irrational+rational= irrational, take for example $c=1/2$. Take $x\in\mathbb{Q}$, clearly $x+c\in\mathbb{Q}$, so $f(x+c)=1=f(x)$. Now, if $x\in\mathbb{R}\setminus{\mathbb{Q}}$, then $x+c\in\mathbb{R}\setminus{\mathbb{Q}}$, so $f(x+c)=0=f(x)$. Then, $f$ is periodic since we have found $c\in\mathbb{R}-\{0\}$ such that for every $x\in\mathbb{R}$, $f(x) =f(x+c) $.