I would like to proof the following theorem.
Let $(X,Y)$ be a random variable with values in $\mathbb{R}^2$. Supposte that $\mathcal{L}(X,Y)$ has density $f(.,.)$ with respect to Lebesgue measure $\lambda^2$ on $\mathbb{R}^2$. If $E[|X|]<\infty$ holds, then $$E[X|Y]=\frac{\int_\mathbb{R}xf(x,Y)dx}{\int_\mathbb{R}f(x,Y)dx}$$
I started like this: Let $A=Y^{-1}(B)$ for $B\in\mathcal{B}(\mathbb{R})$. Then $$ \int_A\frac{\int_\mathbb{R}xf(x,Y)dx}{\int_\mathbb{R}f(x,Y)dx}dP \\=\int_B\frac{\int_\mathbb{R}xf(x,y)dx}{\int_\mathbb{R}f(x,y)dx} P\circ Y^{-1}(dy) \\=\int_B(\frac{\int_\mathbb{R}xf(x,y)dx}{\int_\mathbb{R}f(x,y)dx}\int_\mathbb{R}f(x,y)dx)\ dy \\=\int_B\int_\mathbb{R}xf(x,y)dx\ dy $$ But i am not able to show that the last term is equal to $E[X1_{Y^{-1}(B)}]$.
Continuing from your last identity, we have that \begin{align*} \int_B\int_{\mathbb{R}} xf(x, y) dx dy &= \iint_{\mathbb{R}^2}x 1_{B}(y) f(x, y) dx dy = E\left(X1_B(Y) \right). \end{align*} $$$$ Alternatively, note that \begin{align*} \int_{\mathbb{R}} f(x, y) dx \end{align*} is the marginal density function for $Y$. Then, for any bounded Borel-measurable function $g$, \begin{align*} E\left( X g(Y) \right) &=\iint_{\mathbb{R}^2}xg(y)f(x, y) dx dy\\ &=\int_{\mathbb{R}}g(y)dy \int_{\mathbb{R}}xf(x, y) dx\\ &=\int_{\mathbb{R}}\frac{\int_{\mathbb{R}}xf(x, y) dx}{\int_{\mathbb{R}} f(x, y) dx}g(y) \int_{\mathbb{R}} f(x, y) dx\, dy\\ &=E\left(\frac{\int_{\mathbb{R}}xf(x, Y) dx}{\int_{\mathbb{R}} f(x, Y) dx} g(Y)\right). \end{align*} That is, \begin{align*} E(X \mid Y) &=\frac{\int_{\mathbb{R}}xf(x, Y) dx}{\int_{\mathbb{R}} f(x, Y) dx} . \end{align*}