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?
\begin{align}
f^{-1}([0,1])&amp;=\{x\in X: f(x)\in [0,1]\} \\
&amp;=\{x\in X: x^2\in [0,1]\}\\
%&amp;=\{x\in A: x=\pm\sqrt y\}\\
&amp;=[-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$
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.