# Let $f : X\rightarrow Y$ and $C, D \subseteq Y$. Fill and prove formulas.

Definition:
Let $$f: A\rightarrow B$$ be function and $$X\subseteq A$$.
The image of set X is defined as a set $$f[X] = \{b\in B \:|\: \exists a\in X: f(a) = b\}$$. Inverse image of set $$Y\subseteq B$$ is defined as $$f^{-1} = \{a\in A\:|\:f(a)\in Y\}$$.

Let $$f : X\rightarrow Y$$ and $$C, D \subseteq Y$$. Fill and prove formulas: $$f[f^{-1}[C]] \: ? \: C$$ $$f[f^{-1}[C]] = \: ?$$

I have read few articles about functions, images and inverse images and found that these two formulas should probably be written the following way: $$f[f^{-1}[C]] \subseteq C \text{ for all functions}$$ $$f[f^{-1}[C]] = C \text{ for surjective (onto) functions}$$ I could not find any proofs of them and it is what I am looking for.

By definition $$x\in f^{-1}(C)\implies f(x)\in C$$. Thus $$f(f^{-1}(C))\subseteq C$$.
Now if $$f$$ is surjective, then for each $$c\in C$$, $$f^{-1}(c)\not=\emptyset$$. Hence $$f(f^{-1})(c)=c$$. So $$f(f^{-1})(C)=f(f^{-1})(\bigcup_{c\in C}c)=f(\bigcup_{c\in C}f^{-1}(c))=\bigcup_{c\in C} f(f^{-1})(c)=\bigcup_{c\in C}c=C$$.