F(x) =
- 1, if x is rational
- 0, if x is irrational
So what i am really confused about is because all professors are telling me its periodic whose period is not defined, i mean it doesn't make any sense to me. So they countered me by telling in constant function periodic i said yes but again they asked what is its period. I mean the problem is what is exact definition of periodic function they are not drawing the line. So please help me with understanding it.
The period of a function is the smallest positive $r$ so that $f(x+r) = f(x)$ for all $x$.
But some functions will have an infinite number of $r$s but none of them being a smallest positive $r$ so that $f(x+r) =f(x)$ for all $x$.
These functions are periodic because there do exist $r$ so that $f(x+r) = f(x)$ for all $x$. But the do not have known periods because there is not smallest such (positive) number that do that.
In this case if $r\in \mathbb Q$ then $x+r\in \mathbb Q\iff x\in \mathbb Q$ and so $f(x+r) = f(x)$. But there is no smallest positive $r$ that does this. So $f$ is periodic without a defined specific period.
====
Note the restriction is that $r \ne 0$. Obviously all functions have $f(x+0) = f(x)$ and obviously that doesn't count.