If we have a continuous random variable $X$ with uniform distribution over $(1, 0)$ we can find functions that generate numbers with other distributions using this random variable.
For example if we want to generate numbers with exponential distribution which has the p.d.f $\lambda e^{-\lambda x} $ first we find the inverse of its p.d.f and give the random numbers generated by our uniform R.V. to that inverse function.
But some distributions such as Bernoulli distribution do not have monotone p.d.f and thus we cannot find an inverse function of their p.d.f.
My question is that how to find the desired function— i.e., the function that generates numbers with this new distribution— in this situations?
Edit:
I made a mistake using p.d.f instead of CDF. So all p.d.f.s used above should be replaced by CDF.