Prove that subsets $A$ where $A=f^{-1}(f(A))$ is sigma-algebra 
Let $f:X\to Y$ be a function. Show that $\mathscr{T}=\{A\in\mathscr{P}(X)\mid A=f^{-1}(f(A)) \}$ is a $\sigma$-algebra on $X$.

It is immediate that  $f^{-1}(f(\varnothing))=f^{-1}(\varnothing)=\varnothing$. Let $A\in\mathscr{T}$, then we know that $A=f^{-1}(f(A))$ (*) (or $f|_A$ is injective).
I am having trouble with proving that $X\setminus A\in\mathscr{T}$. The elementary set theory is boggling my mind.
We cannot say that $f^{-1}(f(X\setminus A))=f^{-1}(Y\setminus f(A))$, because for non-injective $f$ this does not work. I tried taking the complement at both sides of (*): $X\setminus A=X\setminus f^{-1}(f(A))=f^{-1}(Y\setminus f(A))$, but I don't no how to get further. I need to use somewhere that $A=f^{-1}(f(A))$. 
I think there is an easy thing I am overlooking. Could someone provide any help?
 A: If $f^{-1}(f(A)) = A$, then $f(A)$ and $f(A^c)$ are disjoint and their union is $f(X)$. Thus $f(A^c) = f(X) - f(A)$ and since $f^{-1}$ commutes with Boolean operations, one gets
$$
f^{-1}(f(A^c)) = f^{-1}(f(X) - f(A)) = f^{-1}(f(X)) - f^{-1}(f(A)) = X- A = A^c
$$
A: A set $A\subseteq X$ is by definition saturated wrt a function $f:X\to Y$ if: $$A=f^{-1}(U)\text{ for some }U\subseteq Y$$
Let $\mathscr{T}'$ denote the collection of subsets of $X$ that are saturated wrt $f$
Then it is not difficult to prove that $\mathscr{T}'$  is a $\sigma$-algebra.
We have: $$\left(f^{-1}(U)\right)^{\complement}=f^{-1}(U^{\complement})\in\mathscr T'$$ assuring that the collection is closed under complementation.
Further we have: $$\bigcup_{n=1}^{\infty}f^{-1}(U_n)=f^{-1}(\bigcup_{n=1}^\infty U_n)\in\mathscr T'$$assuring that a countable union of elements of $\mathscr T'$ is again an element of $\mathscr T'$.
Claim: $$\mathscr{T}=\mathscr{T}'$$(hence $\mathscr T$ is a $\sigma$-algebra)
It is obvious that $\mathscr{T}\subseteq\mathscr{T}'$. 
In order to prove the other side assume that $A=f^{-1}(U)$ for some $U\subseteq Y$. 
Then $f\left(A\right)\subseteq U$ so that $f^{-1}\left(f\left(A\right)\right)\subseteq f^{-1}\left(U\right)=A$.
On the other hand we always have $A\subseteq f^{-1}\left(f\left(A\right)\right)$
so can conclude that $A=f^{-1}\left(f\left(A\right)\right)$.

P.S. For all this injectivity of $f$ is not required.
