there is a function f(x) which is continues
and every rational number "r" is its period of f(x)
prove that f(x)=const
Proof: Suppose the above is false, so that for any neighborhood of there exists points in that neighborhood such that and . It is clear then from that may be written as . So now in the definition of continuity choose so there must exist a such that but this is a conradiction since but
So now back to the problem. Let us talk about our function on an interval . Let and . So by the above lemma we must have that there is an interval such that with elements of that interval. Now let . So we must then have that or that . So for any point of there is a neighborhood such that , thus we must have that
Note: I forgot to mention one important fact...this construction is possible that since no matter how small the neighborhood in question is it must contain at least one rational
There's much simpler (and correct): notice that for any rational , since is -periodic, . In other words, is constant on . Let's say . Now, let be any real number, rational or not. It is well known that there exists a sequence of rational numbers that converges toward . Since is continuous, we conclude (the sequence is constant, equal to ). qed.
Let be a continuous function, if is of fixed value at irrational numbers, then takes that fixed value on rational numbers too, and hence it is a constant function.
Sorry Opalg and transgalactic for the fallacious proof. I always make things harder than they are. How about this alternate proof (this is more for my curiosity then for the OP)
Suppose the claim is true and is constant. We must merely show that is differentiable everywhere and , in other words for all we must show that . But now consider letting . So the above is equivalent to showing but so which finally in turn implies
Suppose that a continuous function on is such that . Let . There is such that if and then . Now, if and , is a limit of non-zero rational numbers with , so that (since this inequality holds for every ). This proves that .
Of course I could be wrong so wait for Laurent or another senior member's confirmation, but what I think Laurent's solution points to is that if with then for all and . Now using this result every number rational or irational is the limit of a sequence of rationals.
In the proof, I wrote "Let be (...)" so that, from this point on, is fixed, you can think of it as a constant, and I am allowed to introduce a sequence converging to . More specifically, I use the fact that any real number (hence for instance, ) is the limit of a sequence of rational numbers. Finally, since I chose to be any number, what I prove for holds for any number.