A question related to the inverse image of a set This may seem like (... or, may be it is) a very trivial question.
Consider a function $f\colon X\to Y$ (Assume that both $X$ and $Y$ are non-empty). Consider the inverse image of $Y$ under $f$, defined by $\:f^{-1}(Y):=\{x\in X:f(x)\in Y\}$. Then is it necessarily true that $f^{-1}(Y)=X$?
My thoughts: Cleary, $f^{-1}(Y)\subset X$ (follows from the definition). Now given $x\in X$, $f(x)\in Y$, so $x\in f^{-1}(Y)$. Hence $X\subset f^{-1}(Y)$, so $X=f^{-1}(Y)$.
Is this reasoning correct? I feel like I am missing something.
 A: Yes, it is correct. $\phantom{long stuff to bypass the lower limit}$
A: Yes, that's true from the definition of the set.
A: It is true to the degree that $f^{-1}$ is defined for all members of $Y$. But this is not always the case. For example, you can define
$$
  \sin : X=\mathbb R \to Y=[-1:1],
$$
and then indeed $f^{-1}(Y)=X$ as you explain. But you could also have defined
$$
  \sin : X=\mathbb R \to Y=\mathbb R,
$$
and in that case $f^{-1}$ is not defined on all of $Y$. So there are cases one needs to be wary of when defining the image $Y$ larger than strictly necessary (strictly necessary would mean setting $Y=f(X)$).
This issue also crops up when you do something like
$$
  \sin : X=[0,\pi] \to Y=\mathbb R.
$$
This is, strictly speaking, a valid definition: The sine, when applied to the range $[0,\pi]$, produces values that are real numbers. But when you consider  $f^{-1}(Y)$ you end with either $[-\pi/2,+\pi/2)$ or some other periodically shifted interval of the real axis, or if you allow for $f^{-1}$ to be multi-valued, you'll get $f^{-1}(Y)=\mathbb R$.
So, you need to be quite specific about how you define $Y$. If you choose the minimal definition $Y=f(X)$, then you can make the inverse statement $X=f^{-1}(Y)$ if you define $f^{-1}$ appropriately (which, as the example of the sine shows, isn't always totally trivial).
