Let $X$ and $Y$ be independent continuous variables with support on $(0,\infty)$. Let $f$ be a continuous positive function, and $I(\cdot)$ is the indicator function (equal to $1$ if $X<Y$, $0$ otherwise). I came across the following expectation $$E\left[I(X<Y)f(X)\right]$$
I have the impression that this expectation is equal to $Pr(X<Y)E[f(X)]$ but I have not been able to prove it. Am I correct?
No, it's not true in general that $\mathbb{E}[1_{X<Y}f(X)]=\mathbb{P}(X<Y)\mathbb{E}[f(X)]$.
For instance, suppose that $X$ and $Y$ are exponentially distributed with parameter $1$, and let $f(x)=x$. Then $$ \mathbb{E}[1_{X<Y}f(X)]=\int_0^{\infty}\int_{x}^{\infty}xe^{-x-y}\;dydx=\int_0^{\infty}xe^{-2x}\;dx=\frac{1}{4}$$ while $$ \mathbb{P}(X<Y)\mathbb{E}[f(X)]=\mathbb{P}(X<Y)\mathbb{E}[X]=\frac{1}{2}\cdot 1=\frac{1}{2}$$