Let $X$ be an absolutely continuous r.v. with density $f$ which is continuous on $(0,\infty)$. Fix $x>0$ and consider some a.s. decreasing sequence $Y_n$ bounded by $X$ such that $Y_n\searrow 0$ a.s. and such that $\mathbb{P}(x<X\leq x+Y_n)>0$. I stress that all variables are **dependent** (in a complicated way).

**The (initial) question.**
I would like to know if the sequence $1_{\{x<X\leq x+Y_n\}}/Y_n$ converges in mean to $f(x)$ (i.e., $\mathbb{E}(1_{\{x<X\leq x+Y_n\}}/Y_n)\to f(x)$) under mild conditions (e.g. $\mathbb{E}(1/Y_n)<\infty$ for all $n$ or $X$ having bounded support).

**Special cases.** The following examples are *not* what I am after, but I include them to provide some intuition and perhaps clarity.

*The independent case.*When $X$ and $Y_n$ are independent for each $n$, this is trivial. Indeed, the function $g_x:y\mapsto\mathbb{P}(x<X<x+y)/y$ is bounded and continuous on $[0,\infty)$ if we set $g_x(0)=g_x(0+)=f(x)$. Hence $$\mathbb{E}(1_{\{x<X\leq x+Y_n\}}/Y_n)= \mathbb{E}(\mathbb{E}(1_{\{x<X\leq x+Y_n\}}/Y_n|Y_n))= \mathbb{E}(g_x(Y_n))\to f(x)$$ by the dominated convergence theorem (as $g_x(Y_n)\to f(x)$ a.s.).*The quotient can be sandwiched.*Assume that some random variables $0<L_n$ and $U_n<1$ are independent of $X$ and satisfy $L_n\leq Y_n/X\leq U_n$ for all sufficiently large (deterministic) $n\in\mathbb{N}$ and $U_n/L_n\overset{L^1}{\to} 1$. In this case, we clearly have $U_n,L_n\overset{\mathbb{P}}{\to}0$ and, for sufficiently large $n$ $$1_{\{x<X\leq x/(1-L_n)\}}/(U_nX)\leq 1_{\{x<X\leq x+Y_n\}}/Y_n\leq 1_{\{x<X\leq x/(1-U_n)\}}/(L_nX).$$ Moreover, we may bound $$\mathbb{E}\left(\frac{1_{\{x<X\leq x/(1-L_n)\}}}{U_nX}\Big|U_n,L_n\right) \geq \mathbb{E}\left(\frac{1_{\{x<X\leq x/(1-L_n)\}}}{U_nx/(1-L_n)}\Big|U_n,L_n\right) =g_x\left(\frac{xL_n}{1-L_n}\right)\frac{L_n}{U_n}.$$ Since convergence in $L^1$ implies convergence in distribution, the continuous mapping theorem and the boundedness of $g_x$ imply that the last quantity converges in $L^1$ to $g_x(0)=f(x)$. Similarly, we bound $$\mathbb{E}\left(\frac{1_{\{x<X\leq x/(1-U_n)\}}}{L_nX}\Big|U_n,L_n\right) \leq \mathbb{E}\left(\frac{1_{\{x<X\leq x/(1-U_n)\}}}{L_nx}\Big|U_n,L_n\right) =g_x\left(\frac{xU_n}{1-U_n}\right)\frac{U_n}{L_n}.$$ which again converges in $L^1$ to $g_x(0)=f(x)$. By sandwiching, we conclude that $\mathbb{E}(1_{\{x<X\leq x+Y_n\}}/Y_n)\to g_x(0)=f(x)$.- Mateusz Kwaśnicki below provided a simple counterexample showing the necessity of some degree of independence between $Y_n$ and $X$.

**The dependence between $X$ and $Y_n$ (additional assumptions).**

(Motivated by

**Special cases**(3) above) We may additionally assume that, for each $n\in\mathbb{N}$, $(X,Y_n)$ has a joint and continuous density.I am particularly interested in the following case. There is a sequence $\{(\theta_n,\xi_n)\}_{n\in\mathbb{N}}$ such that (I) $\theta_n=\prod_{k=1}^n U_k$ for iid $U_k\sim U(0,1)$ (i.e. a stick-breaking process), (II) $\{\xi_n\}_{n\in\mathbb{N}}$ are nonnegative and absolutely continuous with continuous densities and $\sum_{n=1}^\infty \xi_n\in(0,\infty)$ a.s. and (III) conditional on $\theta_{n-1}-\theta_n$, $\xi_n$ is independent of $\{(\theta_{k-1}-\theta_k,\xi_k)\}_{k\neq n}$. Then we define $X=\sum_{k=1}^\infty \xi_k$ and $Y_n=\sum_{k=n}^\infty \xi_k$.

**Flexibility of the result.**
It is not *necessary* that this exact result holds (for me). For instance, it would help if we have sufficient (and mild) conditions for:
(I) $\mathbb{E}(1_{\{x<X\leq x+Y_n\}})/\mathbb{E}(Y_n)\to f(x)$ or
(II) $\mathbb{E}[\mathbb{E}(1_{\{x<X\leq x+Y_n\}}|X)/\mathbb{E}(Y_n|X)]\to f(x)$ or something similar. If you have such a result, a reference would be much appreciated. Counterexamples are also welcome.

(Originally asked in math.stackexchange.)