# If $f(f(f(x)))+f(x)=2$ for all $0≤x≤2$ then find $\int_0^2 f(x) dx$

If $$f(f(f(x)))+f(x)=2$$ for all $$0≤x≤2$$, where $$f(x)$$ is a continuous function, then find $$\int_0^2 f(x) dx$$

Substitute $$f(x)=2-t$$ to get $$$$f(f(2-t))=t$$$$ Take inverse on both sides and then integrate from $$0$$ to $$2$$ $$\int_0^2f(2-t)=\int_0^2f^{-1}(t)$$ On the other hand, substituting $$f(f(x))=z$$ in original equation gives $$f(z)=2-f^{-1}(z)$$ Putting the value of $$f^{-1}(z)$$ back we can solve for $$\int_0^2 f(x) dx=2$$

My solution gave me the right answer, but it's clearly wrong because 1) the range of $$f(x)$$ or $$f(f(x))$$ need not be a subset of the domain and 2) inverse of $$f(x)$$ may not exist. Also, the given data $$0≤x≤2$$ seems to be superfluous here. So what is the proper way of doing it?

• This question looks like there are missing details: it is not specified the domain of $f$ (all we know is that the domain contains $[0;2]$), and the codomain as well. Maybe it is implicitly assumed that $f: [0;2] \to [0;2]$? Nov 10, 2021 at 9:34
• @Crostul that does seem to clear most of the trouble, so I guess you're right! One thread that would be left I suppose is checking for the validity of taking the inverse; will we have to assume an inverse exists? Or maybe there's some slightly different procedure that doesn't require taking an inverse Nov 10, 2021 at 15:44

$$f$$ is not invertible. Consider $$f(f(f(x)))=2-f(x)$$ and suppose $$f$$ is increasing on $$[0,2]$$. Then \begin{align*} f(f(f(0)))2-f(2) \end{align*} Conversly, suppose $$f$$ is decreasing on $$[0,2]$$. Then \begin{align*} f(f(f(0)))>f(f(f(2))),\quad 2-f(0)<2-f(2) \end{align*} It leads contradiction, so $$f$$ cannot increase or decrease on $$[0,2]$$. There's a trivial solution $$f(x)=1$$ to the functional equation that has $$\int_0^2 f(x)dx=2$$ And I'm not sure that there exists other function satisfying the equation.

Edit:

We can prove $$f(x)=1$$. Suppose $$f$$ is a function defined in closed interval $$[0,2]$$. If $$y$$ is in range of $$f$$, then $$2-y$$ is also in range of $$f$$ by $$f\circ f\circ f(x)=2-f(x).$$ Since continuous function maps closed interval to closed interval $$f([0,2])=[1-p,1+p]$$ for $$0\leq p$$. Then suppose $$0 and consider $$f:[1-p,1+p]\to[1-p,1+p]$$. Then following holds. $$f\circ f(x)=2-x$$ Note that $$f$$ is invertible since $$f\circ f\circ f\circ f(x)=x\quad\Rightarrow\quad f^{-1}(x)=f\circ f\circ f(x)$$ We already verified that $$f$$ is not invertible, so $$p=0$$, that is $$f$$ is constant.

• Wow that was really great! So ig I got the correct answer just by chance, even though I made an incorrect assumption? And also, just to be clear, you also assumed that $f: [0;2] \to [0;2]$ is given like @Crostul suggested in his comment, right? Nov 12, 2021 at 6:03
• @Amadeus Yeah, I assumed $f:[0,2]\to [0,2]$. I think that this assumption is necessary because the condition only holds on $[0,2]$.
– suww
Nov 12, 2021 at 6:37
• Thanks for the clarification; btw, I noticed this only just now but isn't $f$ is invertible implied only for $x: [1-p,1+p]$? So it could still be not invertible on $x: [0,2]$ and not contradict our first result Nov 12, 2021 at 6:51
• @Amadeus The same argument can be applied to $[1-p,1+p]$ instead of $[0,2]$. Then $f:[1-p,1+p]\to [1-p,1+p]$ is not invertible and we get contradiction.
– suww
Nov 12, 2021 at 7:30
• Oh yeah I got it now, thanks! Nov 12, 2021 at 7:55