Since f(f(x)) exists it implies that f(x) must be in the domain of f (else we can't form $f(f(x))$. So f must map some set A to itself, i.e. $f:A \rightarrow A$. Examples using say R and C are therefore not valid: the domain of f is either R or C, in this case you would have $f: R \rightarrow C$ and $F: C \rightarrow R$ with $f = F|_R$ (i.e. f is $F$ restricted to R), and then $F(f(x)) = x$.
In general if $f:A \to B$ and $F:B \to A$ then $f = F \implies B = A$, and here $f = F$ is implied by $f(f(x)) = x$.
So with that understanding then f is a bijection.
- f must be onto (surjective) since for all $x \in A$ $f(x) $ is defined (under normal understanding) and $=x$, so for all $x \in A$ there exists $x \in A$ such that $x = f(x)$
- f must be into (injective) as $f(y) = y$ so if $f(x) = f(y)$ then $x = y$.