In my text book, it is written that
Define arcsin as the inverse function of $$\sin : \left[- \dfrac{\pi}{2}, \dfrac{\pi}{2} \right] \to \mathbb R.$$
But I think it is wrong. As far as I remember, functions have the inverse if and only if they are bijective.
$\sin : \left[- \dfrac{\pi}{2}, \dfrac{\pi}{2} \right] \to \mathbb R$ is not surjective. For example, there is no $x_0 \in \left[- \dfrac{\pi}{2}, \dfrac{\pi}{2} \right]$ s.t. $\sin (x_0)=2.$
Isn't it $\sin : \left[ -\dfrac{\pi}{2}, \dfrac{\pi}{2} \right] \to [-1, 1]$ ?
The idea of arcsin is to restrict the domain and codomain of $\sin\colon\mathbb R\to\mathbb R$ to make it bijective, as you say. First of all, since $\sin$ has period $2\pi$ and image $[-1,1]$, we can immediately restrict our function to $\sin\colon(-\pi,\pi]\to[-1,1]$.
However, there is a slight problem here, that $\sin(x)=\sin(\pm\pi-x)$, so for instance, $\sin(\pi/3)=\sin(2\pi/3)$. Thus, we must further restrict our domain to $\sin\colon[-\frac\pi2,\frac\pi2]\to[-1,1]$ (this is best seen graphically). It can be shown that this function is, in fact, bijective.
Surjectivity: clear.
Injectivity: Suppose $x,y\in[-\frac\pi2,\frac\pi2]$ is such that $\sin(x)=\sin(y)$. Then, $0=\sin(x)-\sin(y)=2\cos(\frac{x+y}2)\sin(\frac{x-y}2)$ by the sum-to-product formula. Thus, $\cos(\frac{x+y}2)=0$ or $\sin(\frac{x-y}2)=0$.
If $\cos(\frac{x+y}2)=0$, then since $\frac{x+y}2\in[-\frac\pi2,\frac\pi2]$, we must have $\frac{x+y}2=\pm\frac\pi2$. However, this only happens when $(x,y)=(\frac{\pi}2,\frac\pi2)$ and $(x,y)=(-\frac{\pi}2,-\frac\pi2)$, respectively, and we are done.
On the other hand, if $\sin(\frac{x-y}2)=0$, then again since $\frac{x-y}2\in[-\frac\pi2,\frac\pi2]$, we must have $\frac{x-y}2=0$. We again have $x=y$, which is what was desired.