I have two normal distributions $N(0,\sigma)$ and $N(1,\sigma)$, denoted by their density functions $f_0(x)$ and $f_1(x)$.
With probability $\Pr[b=0]$ some "challenger" selects the distribution 0 (with $f_0(x)$), or with probability $\Pr[b=1]=1-\Pr[b=0]$ distribution 1 (with $f_1(x)$); then he randomly outputs a value $y$ according to that distribution.
Now, given this $y$, I want to know the probability that the challenger used distribution 0 for it.
My approach: Using Bayes' theorem I have $$ \Pr[b=0\;|\;y]=\frac{\Pr[y\;|\;b=0]\Pr[b=0]}{\Pr[y]} =\frac{f_0(y)\cdot\Pr[b=0]}{\Pr[b=0]f_0(y)+\Pr[b=1]f_1(y)}. $$
When plotting this formula the result looks reasonable, but I'm not entirely sure that it is right to directly use the density functions here. So my question is: Is my approach correct?
Edit: I tried to prove it using L'Hospital's rule and the fundamental theorem of calculus: \begin{align*} \Pr[b=0\;|\;y]&=\frac{\Pr[b=0]\Pr[y\;|\;b=0]}{\Pr[y]}\\ &=\lim\limits_{\hat{y}\to y}\frac{\Pr[b=0]\overbrace{\int_{\hat{y}}^{y}f_0(t)\mathrm{d} t}^{\to 0}}{\Pr[b=0]\underbrace{\int_{\hat{y}}^{y}f_0(t)\mathrm{d} t}_{\to 0}+\Pr[b=1]\underbrace{\int_{\hat{y}}^{y}f_1(t)\mathrm{d} t}_{\to 0}}\\ &=\lim\limits_{\hat{y}\to y}\frac{\Pr[b=0]\frac{\mathrm{d}}{\mathrm{d} y}\int_{\hat{y}}^{y}f_0(t)\mathrm{d} t}{\Pr[b=0]\frac{\mathrm{d} }{\mathrm{d} y}\int_{\hat{y}}^{y}f_0(t)\mathrm{d} t+\Pr[b=1]\frac{\mathrm{d} }{\mathrm{d} y}\int_{\hat{y}}^{y}f_1(t)\mathrm{d} t}\\ &=\lim\limits_{\hat{y}\to y}\frac{\Pr[b=0]f_0(y)}{\Pr[b=0]f_0(y)+\Pr[b=1]f_1(y)}\\ &=\frac{\Pr[b=0]f_0(y)}{\Pr[b=0]f_0(y)+\Pr[b=1]f_1(y)}. \end{align*} Is that the right proof or is there an error in my reasoning?