Choosing which variable to take the Fourier Transform with respect to 
Why here do we take the fourier transform with respect to $x$ as opposed to $t$?
 A: When you use Fourier's separation of variables technique, then everything is clear. That's where all of this machinery originated, and I can't understand why authors avoid it.
$$
            \frac{T'}{\kappa T} = -\lambda = \frac{X''}{X},\\
                      X(0) = 0.
$$
You select the bounded solutions only. That means $\lambda \ge 0$ for $T$ equation, and you end up with $X(x) = A\sin(\sqrt{\lambda}x)$. The solution has the form
$$
        u(x,t)=\int_{0}^{\infty}a(\lambda)e^{-\lambda \kappa t}\sin(\sqrt{\lambda}x)d\lambda,
$$
which may also be written as
$$
                   u(x,t)=\int_{0}^{\infty}b(s)e^{-\kappa s^{2}t}\sin(sx)ds.
$$
The final solution is obtained by solving for $b$ such that
$$
                    f(x)=u(x,0)=\int_{0}^{\infty}b(s)\sin(sx)ds \\
                         \implies b(s)=\frac{2}{\pi}\int_{0}^{\infty}f(x)\sin(sx)dx.
$$
You can unravel this to see why the technique stated in your problem will work to give the same result, and to see what techniques work in what variable.
$$
        u(x,t) = \frac{2}{\pi}\int_{0}^{\infty}\left(\int_{0}^{\infty}f(x)\sin(sx)dx\right)e^{-\kappa s^{2}t}ds.
$$
If you change the variable back to $s=\sqrt{\lambda}$, you can see that the outer integral is a Laplace transform in $t$. Finally, verify the solution directly under suitable conditions on $f$, which essentially comes down to knowing that $\sin(sx)e^{-\kappa s^{2}t}$ is a separated solution of the original PDE for fixed $s$.
