# Is there a counterexample for this function?

Let $f: A\rightarrow B$ be a function and consider a subset $Y\subseteq B$.

,is $f(f^{-1}(Y)) = Y$ always true?

• Your statement holds as long as $Y\subseteq f(A)$. Consider the function $f:\{0\}\to\{0,1\}$ via $f(0)=0$ and let $Y=\{1\}$. Then $f^{-1}(Y)=\varnothing$ so $f(f^{-1}(Y))=\varnothing\ne\{1\}$. – Nico Nov 28 '16 at 4:32

Yes, there are counterexamples. Let $A = B = \mathbb{R}$ and let $f(x) = x^2$. Let $Y = \{x \in \mathbb{R} : x \leq 0\}$. Then $$f(f^{-1}(Y))= f(\{0\}) = \{0\} \subsetneq Y.$$
It's always true that $f(f^{-1}(Y)) \subset Y$, as if $x \in f^{-1}(Y)$ then by definition $f(x) \in Y$.
If $Y \subset f(A)$, then it is true, as if $y \in Y$, then since $Y \subset f(A)$ there exists some $x \in A$ such that $f(x) = y$, thus $y = f(x)\in f(f^{-1}(Y))$. Therefore $$Y \subset f(f^{-1}(Y)).$$
No. For example, set $A=B=Y=\mathbb{N}$, and $f:x\mapsto 2x$. Then $f^{-1}(Y)=\mathbb{N}$, but $$\mbox{f(\mathbb{N})=\{evens\}\subsetneq Y.}$$