We define $f^2$ as being the same function as $f \circ f$, so
$f^2(x) = (f \circ f)(x) = f(f(x))$
And then we can extend the notation:
$f^3(x) = (f^2 \circ f)(x) = f(f(f(x))) \\
f^4(x) = (f^3 \circ f)(x) = f(f(f(f(x))))$
and so on. And it also makes sense to say that $f^1(x) = f(x)$.
But what about $f^0(x)$ ? Well, if $f^0$ exists then we want it to satisfy the following identity:
$f(x) = f^1(x) = (f^0 \circ f)(x) = f^0(f(x))$
So $f^0$ is the identity function i.e. $f^0(f(x))=f(x)$ and $f^0(x)=x$. And then if we compose $f^0$ with itself we have
$(f^0)^2(x)=(f^0 \circ f^0)(x) = f^0(f^0(x))) = f^0(x)$
so $f^0 \circ f^0 = f^0$. And also
$(f^0 \circ f^n)(x) = f^0(f^n(x)) = f^n(x)$
In your example, $f$ maps $1$ to $2$ and $2$ to $3$, so $f^2(1)=f(f(1))=f(2)=3$. Similarly $f^2(2) = f(f(2)) = f(3) = 4$. Continuing like this, we have
$f^2=\{(1,3),(2,4),(3,1),(4,2)\}$
In the same way, you can work out what $f^3$ is, and eventually you will find that $f^4(x)=x$, so $f^4=f^0$.
You should now be able to show that $F$ with the operation of composition of functions satisfies all four properties of a group.