Let $(\mathbb{R},\mathcal{B})$ and $P=\lambda\cdot f$, where $f:\mathbb{R}\to\mathbb{R}$, $f(x)=1_{(0,1)}(x)$, $x\in \mathbb{R}$ is the uniform density. Let $X,Y$ be two real random variables defined by $X(x)=2x$, $Y(x)=2x1_{(0,1)}(x)$
"Question": Is it true tha $X = Y$ $P-$a.s?
The question is straight forward to me but getting there is tough: $$P(X\neq Y)=P((-\infty,0)\cup [1,\infty))=\int_{(-\infty,0)\cup [1,\infty)}1_{(0,1)}(x)d\lambda(x) = 0$$
My actual question: Why does the integral appear as such. If $P=\lambda\cdot f$, then why would the integral not become (excuse my lack of knowledge with integrating over a weighted measure)
$$P(X\neq Y)=P((-\infty,0)\cup [1,\infty))\\=\int_{(-\infty,0)\cup [1,\infty)}d(\lambda(x)1_{(0,1)}(x)) \\=\int_{(-\infty,0)\cup [1,\infty)}d\lambda(x)d1_{(0,1)}(x)$$
The notation $P=\lambda\cdot f$ is a bit uncommon to me but I suspect that it must be interpreted as follows.
$P$ is a probability measure on measurable space $\left(\mathbb{R},\mathcal{B}\right)$ defined by: $$P\left(B\right)=\int1_{B}fd\lambda\tag1$$where $\lambda$ denotes the Lebesgue measure on space $(\mathbb R,\mathcal B)$.
Some other notations for the LHS are:
Note that $\left\{ X\neq Y\right\} =\left\{ x\in\mathbb{R}\mid X\left(x\right)\neq Y\left(x\right)\right\} =\left\{ x\in\mathbb{R}\mid2x\neq2x1_{\left(0,1\right)}\left(x\right)\right\} =\left(-\infty,0\right)\cup\left[1,\infty\right)$ so that according to $(1)$: $$P\left(X\neq Y\right)=P\left(\left(-\infty,0\right)\cup\left[1,\infty\right)\right)=\int1_{\left(-\infty,0\right)\cup\left[1,\infty\right)}fd\lambda=0$$Here the RHS is $0$ simply because the integrand is the zero-function.
What you call "my actual question" might arise from misunderstanding of or unfamiliarity with (notation of) integrals. This is confirmed by uncommon notations like $d\lambda(x)d1_{(0,1)}(x)$. I have never seen that before hence have no proper answer to that actual question.