Context: This is part of Exercise 5.2.22(a).
The problem is to describe explicitly the equivalence relation $\sim$ generated by $R=\{(f(x),x):x\in X\}$ as well as the quotient map, where $f:X\to X$ is a function of sets.
I suppose I should use the explicit description of the equivalence relation generated by a set from here. If we write $x\to x'$ for $(x,x')\in R$, then the description says that $\sim$ is equal to the set $\tilde{R}$ of pairs $(x,x')$ such that either $x=x'$ or there exist $x_0=x,x_1,\dots,x_{n-1},x_n=x'\in X$ with either $x_{k-1}\to x_k$ or $x_{k-1}\gets x_k$, for $k=1,2,\dots,n$ (with $n\ge1$).
So in my understanding the problem boils down to find explicitly all pairs $(f(x),x)$ with the property that there exist $x_0=f(x),x_1,\dots,x_{n-1},x_n=x$ such that either $x_{k-1}\to x_k$ or $x_{k-1}\gets x_k$. But how to do this?
For every $x$ we know that $x \sim fx$. In particular we also have that $fx \sim ffx$, and then inductively $x \sim f^nx$ for every $n$. Finally we can conclude that $f^mx = f^ny$ implies $x \sim y$. Since "$x \approx y$ iff $f^mx = f^ny$ for some $m$, $n$" is an equivalence relation and we've shown that $\approx ⊆ \sim$, it follows that $\sim = \approx$.
For general $f$ we can't do better than this, ie. than saying that $x \sim y$ if their orbits under $f$ intersect.
This simplifies if $f$ is invertible. Then we have $x \sim f^kx$ for every $k ∈ ℤ$ (because $f^{-1}x \sim f(f^{-1}x) = x$) and the distinct sets $\{f^kx : k ∈ ℤ\}$ are disjoint, so that $X/{\sim}$ can be succinctly described as the orbit space of the group action associated to $f$ (ie. the action $φ : ℤ → X^X$ such that $φ(1) = f$).