Recently I was trying to see if there exist such interesting example:
Let there be such a random variable $\xi$, that it has probability density function $p(x)$. Is it posible that if I compose it with continuous function $g$ I would get random variable $g(\xi) \not\equiv c \in \mathbb{R}$ that would have discrete distribution.
I was trying hard but could not come up with example of such random variable and continuous function. I would love to listen some examples or explanation why it is not possible. Thanks in advance!
Best Answer
You are not putting enough restrictions to make the problem "difficult" :D , even if it is an interesting observation.
Just choose a bimodal pdf where the two modes are separated by an interval where the pdf is zero. You can also choose $p(x)$ to be continuous, even if this is not a restriction of the OP. Let the support of the first mode be $I_1=(-\infty,a]$ and of the second $I_2=[b,+\infty)$ with $b>a$.
Now it is clear that you can have a function g continuos sending $I_1$ to a constant, $I_2$ to another constant and in between it just connects the two "branches". Again, continuity clearly permits it.
The composition $g \circ X$ is than a r.v. with a discrete distribution, since it has a discrete codomain.
Probably the problem becomes more challanging if you replace the continuity condition with smoothness (both of the p.d.f. and of g), but also in that case I think you can build similar counterexamples, using Bump functions : https://en.wikipedia.org/wiki/Bump_function