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?

$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)$
