TITLE: $f(x+1)=f(x)+1$ and $f(x^2)=f(x)^2$
QUESTION [25 upvotes]: A function that satisfies both $f(x+1)=f(x)+1$ and $f(x^2)=f(x)^2$ for all real $x$ is known to be the identity over $\mathbb Q$, but is it also the identity over $\mathbb R$? If not, can you provide me an example of such a function? Thanks.

REPLY [20 votes]: if $f(x)<x$ for some $x$, you can suppose $x$ and $f(x)$ being greater than $1$. Then $f\left(x^{2^n}\right)< m < x^{2^n}$ for some integers $m,n$, then $f\left(x^{2^n} - m\right) < 0$ being $ x^{2^n} - m > 0$ and that's a contradiction. You can do a similar argument with the other inequality , the argument is very close to the one in the previous answer.