Find a family of random variables $X$, with density $f$, such that $X$ and $Y=f(X)$ have the same distribution. I have to demonstrate the following Probability/Statistics result:
"Find a family of random variables $X$, having pdf $f$, such that $X$ and $Y=f(X)$ have the same distribution."
I have tried to find a proof to this result and I found out that, in the case of pdf $f$ strictly increasing, the result is true if $f$ is the identity function.
I have to find a characterization even in the following 2 cases:

*

*$f$ strictly decreasing;

*$f$ stictly increseasing for $x\leq m$ and stricly decreasing for $x \geq m$ (where $m$ is the mode of the distribution).

Any ideas and/or suggestions?
 A: My previous answer contained a fatal flaw in logic, caused by not taking the absolute value of the determinant of the Jacobian in the change of variables theorem. The following is a more precise answer.

Let $X$ have pdf $f_X(x)$, $Y$ have pdf $f_Y(y)$, and $Y=g(X)$.
By the change of variables theorem (sketches of the proof of which can be found in a previous MSE post Intuitive proof of multivariable changing of variables formula (jacobian) without using mapping and/or measure theory?, we have
$f_Y(y)=f_X(g^{-1}(y))\cdot \left| D_y g^{-1}(y) \right| $
Now, for this question, we are interested in the case where $f_X=f_Y=g$. Call this $f$.
Then the change of variables equation becomes
$f(y)=f\left(f^{-1}(y)\right)\cdot\left|D_y f^{-1}(y) \right|$
and we must now assume $f$ is monotonic since otherwise $f^{-1}$ does not exist as a function. Applying the chain rule, we obtain:
$f(y)=f\left(f^{-1}(y)\right) \cdot \left| \frac{1}{(D_y f) \left( f^{-1}(y) \right) } \right| $
Due to monotonicity,
$f(y)=y \cdot \left| \frac{1}{(D_yf)\left( f^{-1}(y) \right) } \right| $
It can easily be shown that $f(y)=ay^n$, $n=\pm1$, $a\geq0$ are sufficient to fulfill this criterion, but I'm not sure how to prove they are necessary.
Wikipedia's article on Probability density functions gives an interesting formula I hadn't seen in my prob theory courses, which deals with nonmonotonic transformation functions:
$$f_Y(y)=\sum_{k=1}^{n(y)}\left|D_y g_k^{-1}(y)\right|\cdot f_X(g_k^{-1}(y))$$
where $n(y)$ is the number of $x$ such that $g(x)=y$ (essentially this is just combining the strictly increasing and strictly decreasing cases into one function). In your third case, where the density is unimodal, $n=2$ and the formula becomes:
$f(y)=\left|D_yf_1^{-1}(y)\right|\cdot f\left(f_1^{-1}(y)\right)+\left|D_yf_2^{-1}(y)\right|\cdot f\left(f_2^{-1}(y)\right)$
where $f_1, f_2$ are respectively your strictly increasing and strictly decreasing densities on their proper intervals (denoted here with indicator functions $I$):
$f_1(y)=p\frac{y-\mathcal{l}}{m-\mathcal{l}}I_{(\mathcal{l}, m]}(y)$
$f_2(y)=p\frac{1}{y-m+1}I_{(m, n]}(y)$
where $0<\mathcal{l}<m<n<\infty$ and $p=\frac{1}{\frac{m-\mathcal{l}}{2}+\ln{(n-m+1)}}$.
Since
$\left|D_yf_1^{-1}(y)\right|=\left|\frac{m-\mathcal{l}}{p}\right|=\frac{m-\mathcal{l}}{p}$ and
$\left|D_yf_2^{-1}(y)\right|=\left|-\frac{p}{y^2}\right|=\frac{p}{y^2}$
Our density becomes
$f(y)=(y-\mathcal{l})I_{(\mathcal{l}, m]}(y)+\frac{p^2}{y^2(y-m+1)}I_{(m, n]}(y)$
A: I'm here to submit another result that I've just found out.
Considering $f$ strictly decreasing, I know (from previous demonstrated results) that the following equation is valid:
$$1-F\left(f^{-1}(y)\right)=F(y)$$
where we know that $y=f(x)$ so that the equation becomes
$$ 1 - F(x)=F\big(f(x)\big)$$
where $F$ is the CDF and $f$ is the PDF of the random variable $X$, such that
$$1-F(x)=F\big(F'(x)\big)\text.$$
The solution is $$F(x)=\frac{1}{2}+a^{2}\cdot\ln\left(\frac{x}{a}\right)\text.$$
Derivating the expression of $F(x)$ we obtain that
$$ f(x)=\frac{a^{2}}{x}\text.$$
If we consider the following
$$
f(x)=
\begin{cases}
\frac{a^{2}}{x}, \, &{x \in \left[1, e^{\frac{1}{a^{2}}}\right] } \\
0, \, &\text{otherwise}
\end{cases}
$$
Can it be considered as a valid PDF?

*

*$f(x)$ is $\geq 0$, for $x \in \left[1, e^{\frac{1}{a^{2}}}\right] $;

*the integral of $f(x)$ between $1$ and $e^{\frac{1}{a^{2}}}$ is equal to $1$.

