Structure of the proof for showing $A = f^{-1}(f(A))$ iff $f$ is injective I am currently proving the following set theory question for a real analysis course:

Given a function $f : S \to T$ and $A \subset S$ establish the following: $A \subset f^{-1}(f(A))$, with equality for all $A$ iff $f$ is injective.

I do not need help with the details of this proof, however, I am struggling to understand how I should write and format it. Is this question really asking to show $A = f^{-1}(f(A))$ iff $f$ is injective?
If so, do I assume $f$ is injective for both set inclusions ($A \subseteq f^{-1}(f(A))$ and $f^{-1}(f(A)) \subseteq A$ to show equality) or do I simply show $A = f^{-1}(f(A))$ iff $f$ is injective? I just want to make sure I am answering this question in full.
 A: You need to quantify over the $A$ too!
So $f: S \to T$ is injective iff
$$\forall A \subseteq S: A = f^{-1}(f(A))\tag{i}$$
This is not very hard. For proof of injectivity of $f$ from $(i)$ we only need to consider $A$ that have two elements.
A: Prove the first theorem alone: $A\subseteq f^{-1}(f(A)).$
Then, instead of the stated theorem, show the equivalent, and more easily shown:
$$\left(\exists A: A\neq f^{-1}(f(A))\right)\iff (f\text{ is not injective})$$
This is equivalent because $P\iff Q$ is equivalent to $\lnot P\iff \lnot Q,$ and $\lnot \forall A: P(A)$ is equivalent to $\exists A:\lnot P(A).$
First assume $f$ is not injective. Then $f(x)=f(y)$ for some $x\neq y.$ Then let $A=\{x\}.$ You see that $y\in f^{-1}(f(A))$ so $f^{-1}(f(A))\neq A.$
Assume $A\neq f^{-1}(f(A)).$  Now, $A\subsetneq f^{-1}(f(A))$ so there must be a $y\in f^{-1}(f(A))$ such that $y\notin A.$ From there, prove that $f$ is not injective.
A: If $f\colon S \to T$, remember that $U\subset S \rightarrow$ $f^{-1}({\color{red}U}) = \{x\in S : f(x) \in {\color{red}U}\} $,then:
$$f^{-1}({\color{red}{f(A)}}) = \{x\in S: f(x) \in {\color{red}{f(A)}}\}$$
Now note that for all $x\in A$, $f(x)\in f(A)$ is always true, so for all $x\in A, x\in f^{-1}(f(A))$.
NOTE
You have to take care of $f(x)\in f(A)$. This doesn't imply $x\in A$. As you can see in this graph, $f(A)=f(B)$, so if $x\in f(A)$,  then $f^{-1}(A) $ can be $A$, $B$, or another set in $S$. equality only holds if $f$ is injective (why? :D)

