Demonstrate that if $f$ is surjective then $X = f(f^{-1}(X))$
Solution 1:
In this cases double inclusion is the way: let $x \in f(f^{-1}(X))$, then there is $a \in f^{-1}(X)$ such that $f(a) = x$. By definition of the pre image, $x \in X$. This gives $$f(f^{-1}(X)) \subset X.$$ Note that we didn't use that the function is surjective to prove this inclusion, meaning that it holds in general.
Now let $x \in X$. Being $f$ surjective, we can find $a \in A$ such that $f(a) = x$. This gives $a \in f^{-1}(X)$ and hence $x = f(a) \in f(f^{-1}(X))$. This shows $$X \subset f(f^{-1}(X)).$$
Solution 2:
Here is how I would do this: go to the element level, expand the definitions and basic properties, and use logic to simplify. Start with the most complex expression, which is here $\;f[f^{-1}[X]]\;$.
So for any $\;b\;$, \begin{align} & b \in f[f^{-1}[X]] \\ \equiv & \;\;\;\;\;\text{"basic property of $\;\cdot[\cdot]\;$"} \\ & \langle \exists a : a \in f^{-1}[X] \;\land\; f(a) = b \rangle \\ \equiv & \;\;\;\;\;\text{"basic property of $\;\cdot^{-1}[\cdot]\;$"} \\ & \langle \exists a :: f(a) \in X \;\land\; f(a) = b \rangle \\ \equiv & \;\;\;\;\;\text{"logic: use right conjunct in left to substitute"} \\ & \langle \exists a :: b \in X \;\land\; f(a) = b \rangle \\ \equiv & \;\;\;\;\;\text{"logic: extract conjunct which does not use $\;a\;$ out of $\;\exists a\;$"} \\ & b \in X \;\land\; \langle \exists a :: f(a) = b \rangle \\ \equiv & \;\;\;\;\;\text{"assumption: $\;f\;$ is surjective, i.e., $\;\langle \forall b :: \langle \exists a :: f(a) = b \rangle \rangle\;$"} \\ & b \in X \\ \end{align} By set extensionality this proves the statement in question.
Strongly related: the proof of (4) in an answer of mine to another question (https://math.stackexchange.com/a/434230/11994).