Let $f$ be some pdf over $[0,1)$. Here is my question: does there always exist an infinite partition $\{X_{s}\}_{s\,\in\, \mathrm{support}(f)}$ of $[0,1)$ such that if we define $g(x):[0,1)\rightarrow [0,1)$, $g(x)=s$ if and only if $x\in X_{s}$, then we obtain that $x\sim U[0,1)$ implies $g(x)\sim f$?
It seems to me like it must be the case, but I am not sure if there are any weird examples of $f$ where this doesn't hold. Any references appreciated, thanks in advance.
Let $F(x)=\int_{-\infty}^x f(u) du$ be the corresponding cdf of $f$. Let $F^{-1}(y)=\inf\{x\in\mathbb{R}: F(x)\geq y\}$ be the corresponding quantile function of $f$ or $F$. Then $F^{-1}$ is the function $g$ that you want. This is because $F^{-1}$ has the property that $F^{-1}(U)\sim f$ if $U$ is a uniform random variable on $[0,1]$. This is also how the inverse transform sampling method works (proof).