What is the sine of arcsine of $x$? Problem with using trigonometric substitution in integral.

I'm having problems with this $\int \sqrt{1-x^2}\,dx$. Now the text book (Spivak's Calculus) says we can replace $x$ by $\sin u$ ($u = \arcsin x$). Now my question is how can we replace $u$ by $\arcsin x$? If we write $\arcsin x$ then $x$ must be in $[-1, 1]$. $\arcsin(\sin x)) = x$ iff $x$ is in in $[-1, 1]$ right? Well I need some help.

-
$f^{-1}(f(x))=x$ for all $x$ in the domain of $f$. –  icurays1 Sep 2 '13 at 22:46
oh i forgot about that , thanks –  Steve Sep 2 '13 at 22:55
@icurays1 Are you telling me that $\sqrt{x^2}=x$? –  Rahul Sep 2 '13 at 22:58
what the so the first theorem dosen't apply?x must be in the domain of inverse of f? please respond im confused again.. –  Steve Sep 2 '13 at 23:09
@Steve: The first statement is true. If $f(x)$ is an invertible function, then $f^{-1}(f(x)) = x$ for all $x$ in the domain of $f$. As for the comment by Rahul Narain, $\sqrt{x^2} = x$ is not true in general, but $x^2$ is not an invertible function on $\mathbb{R}$. However, if we restrict $x^2$ to the interval $[0, \infty)$, $x^2$ is invertible and has inverse $\sqrt{x}$. In this case $\sqrt{x^2} = x$ for all $x \in [0, \infty)$. –  Michael Albanese Sep 2 '13 at 23:24

Note that $x = \sin u$ implies $u = \arcsin x$ is only true if $u \in [-\frac{\pi}{2}, \frac{\pi}{2}]$. Note that $\sqrt{1-x^2}$ is only defined for $x \in [-1, 1]$ so $\sin : [-\frac{\pi}{2}, \frac{\pi}{2}] \to [-1, 1]$ is a bijection (i.e. $1-1$ and onto). Therefore the substitution $x = \sin u$ is valid.
As has been pointed out in the comments, if $f$ is an invertible function then $f^{-1}(f(x)) = x$ for all $x$ in the domain of $f$. Note that $f = \sin$ is not invertible as it is not $1 - 1$; $\sin 0 = \sin 2\pi$ for example. In order to talk about an inverse for $\sin$ we first restrict the domain to $[-\frac{\pi}{2}, \frac{\pi}{2}]$. On this domain $\sin$ is $1-1$ and hence invertible. As $\sin$ on this domain has range $[-1, 1]$ there is a unique inverse function $\arcsin : [-1, 1] \to [-\frac{\pi}{2}, \frac{\pi}{2}]$.
For all $x \in [-\frac{\pi}{2}, \frac{\pi}{2}]$ we have $\arcsin(\sin x) = x$. As the inverse of $f^{-1}$ is $f$, $\sin$ is the inverse of $\arcsin$. Therefore $\sin(\arcsin x) = x$ for all $x \in [-1, 1]$, the domain of $\arcsin$.