Inverse function and Pre-image how are you doing?
i have a test this saturday in general Algebra(algèbre générale in french), and I was trying for nearly two months to answer this question that has been haunting me up until now, I've asked and asked but my classmates (as always) say that my questions are thourough and aimless; my question is:
can we have an inverse function(application réciproque in french) for a function that is not necessarily a bijection, (i.e: can we have an inverse function for a surjective (or injective or neither of the latter)?
 And the reason why i'm asking this is because if we have for example: a surjective function that maps elements of A to other elements of B ;


*

*and knowing that a function is defined as: for every x in A there is only one image y in B. 


*and that the inverse function is a function.
THEN: f^(-1) of this surjective function is not going to be a function
AND please tell me what is the difference between inverse function and 
pre-image(image réciproque in french)??
 A: I think the easiest way to think about this is with the function $f: \mathbb{R} \to \mathbb{R}$ by $f(x)=x^2$.
This map is neither onto nor injective.  The fact that it is not onto prevents there from being an inverse function from $\mathbb{R}$ all the way back to $\mathbb{R}$ since all the negative numbers are not in the range of $f$, so they would have no pre-image.  We could make the map onto by simply changing the co-domain so it matches the range by saying $f:\mathbb{R} \to [0,\infty)$.  Now at least every element has a preimage.  
Now we see the problem with $f$ not being injective.  Consider the element $1$.  $f^{-1}(1)=\{x\in \mathbb{R} \mid f(x)=1 \}=\{1, -1 \}$.  So the set of pre-images of $1$ has two elements.  If we needed to define an inverse function, it would not be well defined, because $f^{-1}(1)=1$ or $f^{-1}(1)=-1$ are both viable options.  This is why to have an inverse function, the map must be injective or you will always run into this problem.  If $f(x)=f(y)$ but $x \neq y$, then $f^{-1}(f(x))=\{x,y\}$ leaves two places to send this element $f(x)$.
The way people deal with this is by using $\sqrt{x}:[0,\infty) \to [0,\infty)$ as the inverse function of $x^2: [0,\infty) \to [0,\infty)$ by insisting on taking the positive square root.  Now both functions are bijective and are inverses to eachother.  Very similar to why you need to restrict the domain of sine and cosine etc to get inverse functions arcsine and arccosine, etc.
So in short if an element $y$ is in the range of a function, it will have at least one element in the preimage, so you can talk about $f^{-1}(y)$ even if there is not actually an inverse function.
A: In the following, where not otherwise specified, I'm taking the domains and codomains to be $\mathbb{R}$.
As to your first question - if $f: X \rightarrow Y$ is a function, then if it is not a bijection then you can only define the inverse function $f^{-1}$ after reducing the scope of the domain $X$, the codomain $Y$, or both.
If $f$ is not surjective, then there are values in $Y$ that do not correspond to a value in $X$, so there's no meaningful way to assign a value of $f^{-1}$ to them (for example, if $f(x) = e^x$ which is strictly positive, then what value would you assign $f^{-1}(-1)$?).
On the other hand, if $f$ is not injective, then there are elements of $X$ that map to the same element of $Y$, and so in the inverse function which value would they map to? If $f(x) = x^2$, then what's $f^{-1}(-1)$ given that $f(1) = f(-1) = 1$?
As to your second - the preimage is a set, while the inverse function is a function (although there's a lot of simplification in that statement that isn't 100% true when you get to really formal definitions of functions). If $f: X \rightarrow Y$, and $A \subset Y$, then $f^{-1}(A)$ is the set of all values in $X$ that map to a value in $A$. So, for example, if $A = \{ n | n \in \mathbb{N} \}$ and $f(x) = x/2$, then $f^{-1}(A)$ is all half-integers. Note that the preimage exists as long as the set you're taking the preimage of is in the image of the function - even when the inverse function does not exist.
