# Composition of function

aite, here goes f(f(x)=f(x), find all functions that satisfy this on [0,1], i know f(x)=x and f(x)=c satisfy this equation, but im looking for something more outlandish, feel free to make it discontinuous, define it separately over the rationals and irrationals, or any sort of crazy function, i have no clue about the answer, just thought it was an interesting question

I don't think there are any functions apart from those you mentioned that satisfy that identity. Assume f^(-1), which denotes the inverse of f(x), exists. Then taking f^(-1) both sides, gives f(x)=x. Setting, x=c gives the other case. Although I wouldn't be surprised if there are some brilliant functions that satisfy this.

Charles49 is right if we assume f is invertible, and f(x)=x is the only solution for it.
If not, then we can get some crazy functions like
f(x) = 1/2 if x <= 1/2
f(x) = 1 if x > 1/2
This will also satisfy the question.

(maybe this might be true for cantor function?)

I think this question is quite deep if we don't have any restrictions on f,
because we can have this too:
f(x) = floor(x+1/2), and it satisfies the problem too. (nvm for this, it only works for [0,1) )