# Find $f(x)$ from $f(f(x))$

I have this: $$f\colon \mathbb{R} \to \mathbb{R},$$ $$f(f(x)) = x^2 - x + 1$$ I need to show that $f(1) = 1$ and I need to show that $g(x) = x^2 - xf(x) + 1$ is not an one-to-one fuction.

I know how to solve the second problem but I have no idea how to find $f(x)$. Any help is appreciated

-
Your subject says "find $f(x)$, but the questions you've actually asked are really properties about $f$. Do you need to find $f$, or just prove these properties? – Thomas Andrews Oct 5 '12 at 13:01
I need to prove that f(1) = 1 so I have to find f(x) first :) – Rrjrjtlokrthjji Oct 5 '12 at 13:06
No, you don't, as the answers below show - you can find individual values of $f(x)$ without knowing how to compute all the values of $f(x)$. (For example, $f$ might not even exist, but we can prove that if $f$ exists, then $f(1)=1$.) – Thomas Andrews Oct 5 '12 at 13:08
you are correct. – Rrjrjtlokrthjji Oct 5 '12 at 13:09

For the first part, take:

$\forall x \in \mathbb{R}: f(x)^2-f(x)+1 = (f\circ f)(f(x)) = f \circ (f\circ f)(x) = f(x^2-x+1)$. Take $x=1$ and we get : $f(1)^2-f(1)+1 = f(1)$. Now factoring gives us $(f(1)-1)^2 = 0$, so $f(1) = 1$.

-

Hint for the first part, use:

$$f(x^2-x+1) = f(f(f(x))) = f(x)^2 - f(x) + 1$$

-
i dont get how you got to f(f(f(x))) – Rrjrjtlokrthjji Oct 5 '12 at 13:03
Use $f(f(y))=y^2-y+1$ and $y=f(x)$. – Cameron Buie Oct 5 '12 at 13:05
You know that $f(f(x)) = x^2-x+1$, so $f(f(f(x))) = f(x^2-x+1)$ (simply apply f to both sides of the equation) – Stefan Oct 5 '12 at 13:06
Thanks both for the replies! :) – Rrjrjtlokrthjji Oct 5 '12 at 13:08