Discrete Mathematics Function Proof The question is as follows :
Let $f:A\rightarrow B$  be a surjective function and let $C$ be a subset of $B$.  Prove $f(f^{-1}(C)) = C$. 
I understand what the question is asking.  It's basically saying that for some element in $C$, the inverse function points to an element in the domain, $A$, and then for the element in $A$, the function points back to the element in $C$.  
Here's my attempt at the proof :
Let $c$ be contained in $C$, which is also contained in $B$ because $C$ is a subset of $B$.
Let $b$ be contained in $B$, and let $a$ be contained in $A$.
$f:A\rightarrow B$ gives $f(a) = b$.  Assume that the $b$ in $f(a) = b$ is in the set $C$, which is possible because $C$ is a subset of $B$.  Then, $c = b$, so we have $f(a) = c$.  Then, for $f^{-1}(C)$, we would have $f^{-1}(b) = a$, and therefore $f^{-1}(c) = a$.  Then for $f(a)$, we have $c$, which is again in the set $C$.  Hence, $f(f^{-1}(C)) = C$.
If this is incorrect, I'd appreciate feedback and a starting point on where to go with this proof!
Also, I apologize for the poor formatting, I'm not familiar with how to format these types of problems with HTML commands and such.
 A: You have a good start, but there are some issues here.
First, make sure you are clear on all definitions. Note $C$ and $f(f^{-1}(C))$ are sets, so to prove that they are equal you must show that they contain all the same elements. A typical way to do this is by showing $C \subset f(f^{-1}(C))$ and $f(f^{-1}(C)) \subset C$. In your proof, it looks like you only check that $C \subset f(f^{-1}(C))$.
Second, note that $f^{-1}$ is not defined as a function. Rather, $f^{-1}(C)$ for $C$ a subset of $B$ is defined to be the set of all $x \in A$ such that $f(x) \in C$. In particular, it does not make sense to write $f^{-1}(b)=a$ for a single element $b$. You can consider the inverse image of the subset $\{b\}$, which is typically written as $f^{-1}(b)$. However, in this case you would write $a \in f^{-1}(b)$, not that the two are equal -- there may be other elements in the set $f^{-1}(b)$. 
Third, make sure that you use the fact that $f$ is surjective in your proof! When you write "f:A->B gives f(a) = b," how do you know that, for any $b\in B$, you can find an $a$ making this statement true? (In general, if you are given a hypothesis that you do not explicitly use in your solution, you should double check your proof very carefully to be sure you have not made a mistake and/or omitted an explanation. )
A: $f^{-1}(C) =\{ a \in A | f(a)\in C \}$. So let $z\in f^{-1}(C)$. Then $f(z) \in C$ by definition. Therefore $f(f^{-1}(C)) \subset C$. 
Let $c\in C$. Then $c \in B$, so by surjectivity there exists $a\in A$ such that $f(a)=c$. In other words, $a\in f^{-1}(C)$, and so $f(a) \in f(f^{-1}(C))$. Thus, $c\in f(f^{-1}(C))$. Therefore $C\subset f(f^{-1}(C))$. Together this gives $C= f(f^{-1}(C))$
A: At some point, you need to use the fact that $f$ is surjective. Each time you introduce a new variable, you should first think about why such a variable should even exist.
Let's start by showing that $f(f^{-1}(C)) \supseteq C$. To this end, choose any $c \in C$. Now since $C \subseteq B$, we know that $c \in B$. Hence, since $f$ is surjective, we know that there exists some $a \in A$ such that $f(a) = c$. But then since $f^{-1}(C) = \{x \in A \mid  f(x) \in C\}$, we know that $a \in f^{-1}(C)$. But then since $f(D) = \{f(d) \mid d \in D\}$, we conclude that $c = f(a) \in f(f^{-1}(C))$, as desired.
Hopefully you can do the other direction yourself.
