Let $f\colon X\to Y$ be a function. Prove that if for every $A\subseteq X$, we have $A=f^{-1}(f(A))$ then $f$ is one to one (injective)
My try: Let $x,x’\in X$ be such that $f(x)=f(x')$. We need to show that $x=x'$. So we have $$f^{-1}(f(x)) = f^{-1}(f(x'))$$According to the assumption we have $$x = x'$$I don't know whether my proof is correct and rigorous.