Deriving density of a function of a random variable Let $(\Omega, \mathcal{F}, P)$ be a probability space and $X: \Omega \to \mathbb{R}$ a continuous random variable.  Let $Y:\mathbb{R} \to \mathbb{R}$ be Borel-measurable.  Finally, let $f_X: \mathbb{R} \to \mathbb{R}$ be the probability density function (pdf) of $X$.  I'd like to derive the pdf of $Y \circ X$ as "rigorously" as possible, but I'm really not sure how to proceed.
Setup:
By definition, for all Borel sets $A$,
$$
P(X \in A) = \int_A d(P \circ X^{-1}) = \int_A f_X d\lambda,
$$
where $\lambda$ is the Lebesgue measure on $\mathbb{R}$.  I need to find a function $f_{Y \circ X}: \mathbb{R} \to \mathbb{R}$ such that for all Borel sets $B$,
$$
P(Y \circ X \in B) = \int_B f_{Y \circ X} d\lambda.
$$
I've considered using the change of variables theorem, but $X$ being monotone is nonsensical here.  I'd appreciate a good push in the right direction!
 A: You need further assumptions on the transformation to ensure that the transformed random variable has a density. I will use a different letter for the transformation since $Y$ is usually meant to be a random variable. 
Let $u:\mathbb{R}\to\mathbb{R}$ be a bijective (hence $u^{-1}$ exists), Borel-measurable map and consider $Y=u(X)$. Then for $B\in\mathcal{B}(\mathbb{R})$ one has
$$
\begin{align}
P(Y\in B)&=\int_\mathbb{R}\mathbf{1}_B(u(x))f_X(x)\,\lambda(\mathrm dx)\\
&=\int_\mathbb{R} \mathbf{1}_B(u(x))f_X(u^{-1}(u(x)))\,\lambda(\mathrm dx)\\
&=\int_\mathbb{R} \mathbf{1}_B(x) f_X(u^{-1}(x))\,(\lambda\circ u^{-1})(\mathrm dx),
\end{align}
$$
where the last equality follows from the change of variables theorem. Thus $Y$ has density $f_X\circ u^{-1}$ with respect to $\lambda\circ u^{-1}$.
If we furthermore assume that $u$ is affine, i.e. $u(x)=ax+b$ for $a,b\in\mathbb{R}$ and $a\neq 0$, then it is straightforward to show that $\lambda\circ u^{-1}$ has density $|a|^{-1}$ with respect to $\lambda$. Hence, in this case, $Y$ has density
$$
x\mapsto f_X(u^{-1}(x))|a|^{-1}
$$
with respect to $\lambda$.
