$\newcommand{\E}{\mathbb E}\newcommand{\PM}{\mathbb P}$This question is inspired by this question which is unfortunately closed. Anyways, I found it interesting, so I tried to solve it.
The problem was as follows:
Problem. Let $X$ be a random variable which has a finite second moment, i.e. $\E[X^2]<\infty$. Show that there exists a non-negative function $f:\mathbb R\to[0,\infty)$ such that the following holds:
- $f$ is non-decreasing on $(0,\infty)$
- $f(x)\to\infty$ as $x\to\infty$
- $\E[X^2f(X)]<\infty$
Attempt.
Firstly, I thought that $f(x)=\log(1+|x|)$ should do the work, but after some thoughts I have discovered that it is not guaranteed to work. Secondly, I have considered an Ansatz method which basically ended up with \begin{align*} f(x) = \sum_{k=1}^\infty \frac{1}{k} \mathbf{1}_{\{a_k \leq x\}} \end{align*} which has all the properties if $a_k$ is strictly increasing to $\infty$. Now we have \begin{align*} \E\left[ X^2 f(X)\right]&=\E\left[X^2\sum_{k=1}^\infty \frac{1}{k}\mathbf{1}_{\{a_k\leq X \}}\right]\\ &\stackrel{\text{Fatou}}{\leq} \sum_{k=1}^\infty \frac 1 k \E[X^2\mathbf{1}_{\{a_k\leq X \}}] \end{align*} I really would like to have \begin{align*}\tag{$*$} \E[X^2\mathbf{1}_{\{a_k\leq X \}}]\leq \frac 1 {k^\alpha} \end{align*} for some $\alpha>0$. We know that \begin{align*} \lim_{y\to\infty} \E[X^2 \mathbf{1}_{\{y\leq X\}}]\stackrel{\text{DCT}}{=}0 \end{align*} which means that we can find a sequence $a_k$ stricly increasing to infinity satisfying $(*)$. We have constructed $f$ with all the properties.
Question. Are there other methods for constructing such function $f$? Can it be done easier?
To be honest, it costed me a couple of trials to actually come up with an example.