First, I claim that $g(0)=0$. To prove this, note that since $g$ is injective and continuous, it is either increasing or decreasing. If it is increasing then $g(0)$ and $g(g(0))$ have the same sign so the only way they can add to $0$ is if $g(0)=0$. If $g$ is decreasing, then $g(0)$ and $g(g(0))$ have opposite sign and then by the intermediate value theorem there must be $x$ between $0$ and $g(0)$ such that $g(x)=x$. But then the functional equation says $2x=x$ so $x=0$ and thus $g(0)=0$.
Now consider the function $h(x)=g(x)/x$ on $\mathbb{R}\setminus\{0\}$. Since $g(g(x))+g(x)=x$, we have $$h(g(x))h(x)+h(x)=\frac{g(g(x))}{g(x)}\cdot\frac{g(x)}{x}+\frac{g(x)}{x}=1$$ and thus $$h(g(x))=T(h(x))$$ where $$T(x)=\frac{1-x}{x}.$$ Note moreover that since $g$ is monotone with $g(0)=0$, $h$ must always have the same sign.
Now suppose $g$ is increasing, so $h(x)>0$ everywhere. We then must have $T(h(x))>0$ as well and so $h(x)<1$. But then we must have $T(h(x))<1$ and so $h(x)>1/2$. Similarly we find that $h(x)<T^{-n}(1)$ for each even $n$ and $h(x)>T^{-n}(1)$ for each odd $n$. But the sequence $(T^{-n}(1))$ for even $n$ is decreasing and hence converges to a fixed point of $T^2$ and for odd $n$ it is increasing and so again converges to a fixed point of $T^2$. The unique positive fixed point of $T^2$ is $\alpha=\frac{\sqrt{5}-1}{2}$ and so we must have $h(x)=\alpha$ for all $x\neq 0$ and so $g(x)=\alpha x$ for all $x$.
(In more intuitive terms, what's going on here is that $\alpha$ is a repelling fixed point of $T$, and so if $x$ is not exactly equal to $\alpha$ then $T^n(x)$ will eventually get far away from $\alpha$. In particular, it turns out that $T^n(x)$ will always get far enough away to become negative, contradicting that $h$ needs to be positive.)
The case that $g$ is decreasing is a little more complicated since the negative fixed point $\beta=\frac{-\sqrt{5}-1}{2}$ of $T$ is attracting instead of repelling. The trick is that $\beta$ is a repelling fixed point of $T^{-1}$ and so we can use a similar argument with $T^{-1}$ as long as we first show that $g$ is surjective. To see that $g$ is surjective, note that since $h(x)$ is always negative, $h(g(x))<-1$ for all $x$, and so $|g(g(x))|>|g(x)|$ for all $x\neq 0$. Now the image of $g$ is some possibly unbounded interval $I$. Since $|g^3(x)|>|g^2(x)|>|g(x)|$ for all $x\neq 0$ and $g^3(x)$ has the same sign as $g(x)$, the image of $g^3$ must also be $I$ (since as $g(x)$ approaches the upper and lower bounds of $I$, so does $g^3(x)$). Since $g$ is injective, this means that $g^2$ is surjective (otherwise $g^3=g\circ g^2$ would have smaller image than $g$) and so $g$ is surjective.
Now we have $$h(x)=T(h(g^{-1}(x)))$$ for all nonzero $x$. Since $h(g^{-1}(x))$ is always negative, this implies $h(x)<-1$. But then $h(g^{-1}(x))<-1$ and so $h(x)>-2$. Similarly we find $h(x)<T^n(-1)$ for all even $n$ and $h(x)>T^n(-1)$ for all odd $n$. As in the previous case, these bounds converge to $\beta$, the unique negative fixed point of $T^2$, and so $h(x)=\beta$ for all $x\neq 0$ and $g(x)=\beta x$ for all $x$.
Let $a$ and $b$ be real numbers. We shall determine all $f:\mathbb{R}\to\mathbb{R}$ such that
$$f(x+1)=a\,f(x)+b\tag{*}$$
for every $x\in\mathbb{R}$.
If $a=0$, then $f(x)=b$ for all $x\in\mathbb{R}$. We assume from now on that $a\neq 0$. We first deal with the case $a>0$.
If $a=1$, then we have $f(x+1)=f(x)+b$ for all $x\in\mathbb{R}$. By setting $g(x):=f(x)-b\,x$, we see that $g(x+1)=g(x)$ for all $x\in\mathbb{R}$. That is, $g$ is periodic with period $1$. Therefore, $$f(x)=g(x)+b\,x$$ for all $x\in\mathbb{R}$, where $g:\mathbb{R}\to\mathbb{R}$ is periodic with period $1$.
If $a\neq 1$, then let $g(x)=\dfrac{1}{a^x}\,\left(f(x)+\dfrac{b}{a-1}\right)$ for all $x\in\mathbb{R}$. We can then see that $g$ is again periodic with period $1$. Therefore,
$$f(x)=a^x\,g(x)-\frac{b}{a-1}$$
for all $x\in\mathbb{R}$, where $g:\mathbb{R}\to\mathbb{R}$ is periodic with period $1$.
We now deal with the case $a<0$. Define $g(x):=\dfrac{(-1)^{\lfloor x\rfloor}}{(-a)^x}\left(f(x)+\dfrac{b}{a-1}\right)$ for all $x\in\mathbb{R}$. We see that $g(x+1)=g(x)$ for all $x\in\mathbb{R}$. Thus,
$$f(x)=(-1)^{\lfloor x\rfloor}\,(-a)^x\,g(x)-\frac{b}{a-1}$$
for all $x\in\mathbb{R}$, where $g:\mathbb{R}\to\mathbb{R}$ is periodic with period $1$.
If $f:\mathbb{Z}\to\mathbb{R}$ satisfies (*) for all $x\in\mathbb{Z}$, then the solutions are:
- if $a=0$, then $f(x)=b$ for all $x\in\mathbb{Z}$;
- if $a=1$, then there exists a constant $c\in\mathbb{R}$ such that $f(x)=c+b\,x$ for all $x\in\mathbb{R}$;
- if $a\notin\{0,1\}$, then there exists a constant $c\in\mathbb{R}$ such that $f(x)=a^{x}\,c-\dfrac{b}{a-1}$ for all $x\in\mathbb{R}$.
Best Answer
For $x\neq0$ and $x\neq1$ we obtain: $$f(x)=x^2f\left(\frac{1}{x}\right)=x^2f\left(\frac{1}{x}-1+1\right)=x^2\left(f\left(\frac{1}{x}-1\right)+1\right)=$$ $$=x^2+x^2f\left(\frac{1-x}{x}\right)=x^2+x^2\cdot\frac{f\left(\frac{x}{1-x}\right)}{\frac{x^2}{(x-1)^2}}=x^2+(x-1)^2f\left(\frac{x}{1-x}\right)=$$ $$=x^2+(x-1)^2f\left(\frac{1}{1-x}-1\right)=x^2+(x-1)^2\left(f\left(\frac{1}{1-x}\right)-1\right)=$$ $$=x^2-(x-1)^2+(x-1)^2\cdot\frac{f(1-x)}{(1-x)^2}=2x-1-f(x-1).$$ Thus, $$f(x)+f(x-1)=2x-1$$ or $$f(x)+f(x+1)=2x+1,$$ which gives $$f(x)+f(x)+1=2x+1$$ or $$f(x)=x.$$ Now, show that $f(0)=0$ and $f(1)=1.$