Sin(x): surjective and non-surjective with different codomain? Statement that $\operatorname{sin}(x)$ not surjective with codomain $\mathbb R$ and surjective with codomain $[-1,1]$ found here:


*

*Non-surjective: $\mathbb{R}\rightarrow\mathbb{R}: x\mapsto\operatorname{sin}(x)$

*Surjective: $\mathbb{R}\rightarrow[-1,1]: x\mapsto\operatorname{sin}(x)$
where the image $Im(f)=[-1,1]$ in both cases and the codomain is $\mathbb R$ and $[-1,1]$ for the case 1 and case 2, respectively. In the second case, $\forall x\in\mathbb R : \operatorname{sin}(x)\in [-1,1]$ where the codomain equals the image of $f$. Surjection means that the image of the function equals to the codomain.
Why is sin not surjection with one codomain and surjective with other codomain?
 A: The functions $\operatorname{sin}:\mathbb R\rightarrow \mathbb R$ and $\operatorname{sin}: \mathbb R\rightarrow [-1,1]$ are two different functions. In mathematics, a function is usually defined as the collection of the following data:


*

*Specifying the domain X (a set)

*Specifying the codomain Y (a set) 

*A relation on $X\times Y$ satisfying certain properties
and so the mathematical function can be understood as an ordered triple set $\{X,Y,R\}$ where $R$ is the relation such as $X\times Y$. The usual notation is $f:X\to Y$.
In this strict sense, the string ''sin'' can represent infinitely many different functions, depending on the choice of domain and codomain. Some of them are surjective, injective, bijective, or none if that. For example, $\sin: [0,1]\to\Bbb R$ is injective but not surjective, $\sin: \Bbb R\to [-1,1]$ is surjective and not injective, $\sin: [-\pi/2,\pi/2]\to [-1,1]$ is bijective and so on.
However, that's not the whole story. In physics and engineering, one often ignores the specification of domain or/and codomain and assumes that it is understood from the context. In this sense, ''$\sin x$'' is an assignment that to a real number $x$ assigns $\sum_{i=0}^{\infty} (-1)^{i}\frac{x^{2i+1}}{(2i+1)!}$. Here you don't care about domains and codomains. This is often good enough for practical considerations. But from the formal viewpoint, it doesn't make sense to ask whether this ''function'' $\sin$ is surjective, if you don't specify the domain and codomain.
A: $f(x)=\sin(x)$ is not a surjection from $\Bbb R\to \Bbb R$
$f(x)=\sin(x)$ is a surjection from $\Bbb R\to [-1,1]$
The wiki page tells you that in the case of $\Bbb R\to [-1,1]$ that $\sin(x)$ is a surjection but is not an injection.  It is a surjection because every possible output has a preimage.  Suppose $y\in [-1,1]$.  Then for $x=\arcsin (y)\in\Bbb R$ you have $f(x)=\sin(\arcsin(y))=y$.
The wiki page also tells you that in the case of $\Bbb R\to \Bbb R$ that $\sin(x)$ is not a surjection and is not an injection.  It is not a surjection because there exists no preimage for, say, the point $2$ in the codomain.  There is no real value of $x$ such that $\sin(x)=2$.
Neither case is an injection because you can have multiple $x$ values which map to the same output, for example $\sin(\pi)=\sin(3\pi)$
