A question about surjective functions. I am looking for a sample of surjective function $f:X \to Y$ and a set $A \subseteq X$ such that $f^{-1}(f(A))\neq A$.  
Is the  sample $f(x)=x^2, f^{-1}(x)=\sqrt{x}, X=\mathbb{R}, Y=[0, +\infty), A=[-1,1]$  a correct one?
 A: \begin{align}
f^{-1}([0,1])&=\{x\in X: f(x)\in [0,1]\} \\
&=\{x\in X: x^2\in [0,1]\}\\
%&=\{x\in A: x=\pm\sqrt y\}\\
&=[-1,\,1]
\end{align}
So, it is not one-one and so you can not claim that $f^{-1}(x)=\sqrt x$ rather $f^{-1}(x)=\{\sqrt x,\,-\sqrt x\}$.
Hence if $A=[0,1]$ then $f^{-1}(f(A))=f^{-1}([0,1])=[-1,1]\neq A$
A: You are almost there. Just let $A=[0,1]$, then $f(A)=[0,1]$ so that 
$$
f^{-1}(f(A))=[-1,1]\neq [0,1]=A.
$$
Here, I take $f^{-1}(B)$ to mean $\{x:f(x)\in B\}$. This way you just need to find $A$ such that there are elements outside of $A$ that get mapped to $f(A)$. This is the precise condition that implies $f^{-1}(f(A))\neq A$.
A: By definition, $\mathrm{f}^{-1}$ is the function for which $(\mathrm{f}^{-1}\! \circ \mathrm{f})(x) = x$ for all $x$ in the domain of $\mathrm{f}$. As a result, $(\mathrm{f}^{-1} \! \circ \mathrm{f})(A) = A$ for all $A \subseteq X$.
For $\mathrm{f}^{-1}$ to exist, you need $\mathrm{f} : X \to \mathrm{f}(X)$ to be injective. If it were many-to-one, e.g. $\mathrm{f}(x_1) = \mathrm{f}(x_2)=y$ with $x_1 \neq x_2$, then how would you define $\mathrm{f}^{-1}(y)$? Is it $x_1$ or is it $x_2$? It can't be both because a function cannot be one-to-many. (A mapping can be, but not a function.)
In your example $\mathrm{f} : [-1,1] \to [0,1]$ is no injective and so there is no well-defined inverse. 
The inverse of $\mathrm{f} : x \mapsto x^2$ is given by $x \mapsto \sqrt{x}$ only when the domain of $\mathrm{f}$ is restricted to a subset of the non-negative real numbers. The inverse of $\mathrm{f} : x \mapsto x^2$ is given by $x \mapsto -\sqrt{x}$ only when the domain of $\mathrm{f}$ is restricted to a subset of the non-positive real numbers.
