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
??
First let us establish a lemma. Ifis continuous at
then there exists a neighborhood
such that for any
the following must be true,
.
Proof: Suppose the above is false, so that for any neighborhood ofthere 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

This lemma somehow tells that a continuous function is locally monotonous. This fails to be true... Think offor instance, at 0. It is continuous and it oscillates so the conclusion of the lemma can't be satisfied. The problem in the proof comes from the fact that there is no reason why
would be in
. (
is defined given
)
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.
Once I was asked a question by my professor in real analysis lesson, now I feel that it is very similar to this problem.
Letbe 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.
Uh, butis not continuous at zero. And I think I stated my Lemma wrong. It was meant to be that there exists a neighborhood of c such that there is a subset of that neighborhood that such that the above is true. Supposing that this suffices it still shows the result of the question and I believe it works for your example.
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 andis 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
![]()

Just for your curiosity. There is one step that would require a justification: if
exists, why would
exist as well? This is quickly proved from the definition of the limit (cf. right below), but I think it should be underlined since this is where the continuity is needed, and thus this is the core of the proof.
Suppose that a continuous functionon
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 ifwith
then
for all
and
. Now using this result every number rational or irational is the limit of a sequence of rationals.

I'm not sure I get what you mean.
In the proof, I wrote "Letbe (...)" 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.