How do I prove this assumption f: X → Y is a function and that f is surjective? Prove that for all $B ⊆ Y$, we have $f (f^{-1}(B)) = B$?

Where can  I start this problem?
Knowing that f is surjective if ∀ b ∈ B ∃ a ∈ X when f(a) = b.
How do you show that B is a subset of Y to get the inverse image or pre-image of B, that is $f (f^{-1}(B)) = B$?
I'm acquainted with the definition of surjectivity, which states that for every y element of Y (codomain) it must satisfy a specific x element of X (domain).
I sincerely appreciate your guidance.
 A: First, we don't need to show that $B$ is a subset of $Y$, since that's given. 
Now, to prove two sets are equal, we need to prove that either set is a subset of the other. 
Suppose that $x\in f(f^{-1}(B))$. Then there exists $y\in f^{-1}(B)$ such that $f(y)=x$. Further, since $y\in f^{-1}(B)$, there exists $z\in B$ such that $f(y)=z$. Then we have $x=f(y)=z\in B$, so $x\in B$. Note that we didn't need surjectivity for this part. 
Now suppose $x\in B$. Since $f$ is surjective, there exists $y\in X$ such that $f(y)=x$. Then we have that $y\in f^{-1}(B)$, and so $x\in f(f^{-1}(B))$. 
Therefore, the two sets are equal. 
A: Given a map $f:X\to Y$ and a subset $B$ of $Y$, recall that $f^{-1}(B)$ is defined as the set of all $x\in X$ such that $f(x)\in B$.
Now if $y\in f(f^{-1}(B))$, there exists $x\in f^{-1}(B)$ such that $y=f(x)$, but this implies that $y\in B$.
We have proved so far (without any special assumption) that $f(f^{-1}(B))\subset B$.
Equality is not true in general, as we can see with $f:\mathbb{R}\to\mathbb{R},\,x\mapsto x^2$ and $B=[-1,1]$ :
in this case : $f(f^{-1}(B))=f([-1,1])=[0,1]\neq B$
Now suppose $f$ is surjective and consider $y\in B$. There exists $x\in X$ such that $y=f(x)$ which implies $x\in f^{-1}(B)$ and therefore $y\in f(f^{-1}(B))$.
Finally, if $f$ is surjective then for all $B\subset Y$, we have : $f(f^{-1}(B))=B$.
Remark
It should be added that the converse is true : if $f:X\to Y$ is such that $\forall B\subset Y,\,f(f^{-1}(B))=B$, then $f$ is surjective.
Proof : considering $y\in Y$ an choosing $B=\{y\}$, we get : $f(f^{-1}(\{y\}))=\{y\}$. Hence $f^{-1}(\{y\})\neq\emptyset$.
