I have this statement:
Let $f: \mathbb{R} \to \mathbb{R},$ and $f(f(x)) = x-1$ prove that $f$ is bijective
My attempt was:
$(1)$ Use the fact that if a composite function $gof$ is bijective then $f$ is bijective. In this case, if $fof$ is bijective, then $f$ is bijective.
First, prove $fof$ is injective. To prove: $f(f(x_1)) = f(f(x_2)) \to x_1 = x_2$
$x_1 -1 = x_2 - 1 \to x_1 = x_2$ and proved.
Second, prove $fof$ is surjective. Using the fact that the codomain of $gof$ is equal to the codomain of $g$, then in this case, the codomain of $f$ is $\mathbb{R}$ and therefore the codomain of $fof$ is $\mathbb{R}$ and noting that the range of $x -1$ is the same, we can conclude that $fof$ is surjective.
And using $(1)$, i proved that $f$ is bijective.
My teacher told me that my development was wrong and i dont know why. Thanks in advance.
Hint:
Perhaps your teacher meant that what you say in (1) is false...Try to prove the following:
a) If the composition $\;f\circ g\;$ is injective, then $\;g\;$ is injective
b) If the composition $\;f\circ g\;$ is surjective then $\;f\;$ is surjective
With the above you must prove at once what you want, which is way more general than the example you have.