Just wanted to verify this proof was correct. Trying to make sure I have a handle on these subjects before the exam. Any style comments also more than welcome.
Statement: Let $f : A \mapsto B$ be a function. $f$ is injective if and only if for all $X \subseteq A$, $f^{-1}(f(X)) \subseteq X$.
Proof:
$\Rightarrow$ Suppose that $f$ is injective. Let $X \subseteq A$, and let $x \in X$. Since $f$ is injective, $f^{-1}(f(X)) = \{x\} \in X$, so $f^{-1}(f(X)) \subseteq X$.
$\Leftarrow$ Suppose that for all $X \subseteq A$, $f^{-1}(f(X)) \subseteq X$. Let $a_1, a_2 \in A$ and $X = \{a_1\}$. Suppose $f(a_1) = f(a_2)$. If $a_1 \neq a_2$, then $f^{-1}(f(X)) = \{a_1, a_2\} \not \subseteq X$, a contradiction. Thus $a_1 = a_2$, so $f$ is injective.
The $\impliedby$ proof looks good.
For the $\implies$ proof two things. First, you wrote $f^{-1}(f(X)) = \{x\}$. I think you mean $f^{-1}(f(\{x\})) = \{x\}$. This is true by injectivity, but you need to argue it (give more details).
Second, you then conclude $f^{-1}(f(X)) \subseteq X$. How? This is true but you need more details. You could write $f^{-1}(f(X)) = f^{-1}(f(\bigcup_{x \in X} \{x\})) = \bigcup_{x \in X} f^{-1} (f(\{x\})) \subseteq X$. This would work.