# Continuous functions remaining constant

I solved a problem in analysis and i was thinking of generalizing this question which i couldn't succeed.

If $f:\mathbb{R} \to \mathbb{R}$ is a continuous function which satisfies $f(x)=f(2x+1)$, for all $x \in \mathbb{R}$ then prove that $f$ is constant. I was able to prove it considering $g(x)=f(x-1)$ and showing that $g(x) \to g(0)$.

Now my question is suppose $f: \mathbb{R} \to \mathbb{R}$ is a continuous function and satisfies $f(p(x))=f(x)$ for every polynomial $p(x) \in \mathbb{R}$, then what should be the condition on $p(x)$ such that $f$ remains constant.

-
There seems to be some kind of quantifier error in your question: if $f(p(x)) = f(x)$ for every polynomial $p(x) \in \mathbb{R}[x]$, then in particular it holds for $p(x) = 2x+1$ so by what you say above $f$ is constant. (Or, easier: for each $c \in \mathbb{R}$, take $p(x) = x+c$.) I think you mean to ask: for which polynomials $p \in \mathbb{R}[x]$ does $f = f \circ p$ imply that $f$ is constant. Is that correct? – Pete L. Clark Jul 15 '10 at 12:26
@Pete: or easier, take $p(x) = c$. You can even drop the continuity assumption. :) – Willie Wong Jul 15 '10 at 12:34
I'm also added the dynamical systems tag as I think that this question can be interpreted as something like ergodicity of the iterated map $p^n(x)$. But I am not sure. – Willie Wong Jul 15 '10 at 12:52
This is related to the concept of "topological transitivity" in dynamical systems. A continuous transformation $T$ of a metric space $X$ is called topologically transitive if for every pair of nonempty open sets $U, V$, there exists $n$ such that $T^n(U) \cap V \neq \emptyset$. If $X$ is compact, then topological transitivity implies that any continuous real-valued $f$ such that $f = f \circ T$ must be constant. On the other hand, this statement about $T$-invariant continuous functions is strictly weaker than topological transitivity. I'm not quite sure how this works in the noncompact case. – Ian Morris Jul 15 '10 at 13:22

I'll assume, per Pete's comment above, that you are looking for polynomials $p(x)$ with real coefficients such that $f(p(x)) = f(x)$ implies $f$ is constant.
It suffices (though I am not sure if this is necessary) then that $p(x)$ has a fixed point that is strictly unstable or strictly stable in the strict sense. In other words, there exists $x_0$ such that $p(x_0) = x_0$ and such that $|p(x - x_0)| > (1+\epsilon) |x-x_0|$ for some $\epsilon > 0$ or $|p(x - x_0)| < (1 - \epsilon)|x - x_0|$. Basically the exact same argument you used to show the property for $2x+1$ can be used for this case.
This was a putnam problem. If $f$ is continuous and satisfies $f(2x^{2}-1)=2xf(x)$ then $f \equiv 0$ on $[-1,1]$. See for this also $f$ remains a constant. – S.C. Jul 16 '10 at 10:52