# Proof involving images and inverse images

Let $f:A \rightarrow B$ be a function, $C \subseteq A$ and $S \subseteq B$ be subsets. Prove that $$f(C) \subseteq S \Leftrightarrow C \subseteq f^{-1}(S).$$ Definitions I am using:

Let $f:A \rightarrow B$ be a function, $P \subseteq A$, then
$f(P) = \{a \in B \mid a = f(x) \text{ for some } x \in P \}$

Let $Q \subseteq B$, then
$f^{-1}(Q) = \{a \mid f(a) \in Q \}$

My work so far:

If it turned out that $f(C) \subseteq S \Leftrightarrow (x \in C \Rightarrow f(x) \in S )$ for all x $\in A$, then I would know how to proceed.

Suppose that $f(C) \subset S$. Then, let $x \in C$. Note that $f(x) \in f(C) \subset S$, so that $f(x) \in S$, hence $x \in f^{-1}(S)$. Therefore $C \subset f^{-1}(S)$.
Next, suppose that $C \subset f^{-1}(S)$. Let $y \in f(C)$, then $y = f(x)$ for some $x \in C$. Note that $C \subset f^{-1}(S)$, so that $x \in f^{-1}(S)$, hence $f(x) \in S$. But then $y=f(x)$, so $y \in S$, hence $f(C) \subset S$.
Hence, $C \subset f^{-1}(S)\iff f(C) \subset S$.