Consider a population of samples that depend on a variable $X$ and are distributed between one of 2 classes (e.g. Green and Red like this).
The probability density functions $p_G(x)$ and $p_R(x)$ for each of the 2 classes are known.
Given a value for $X=x$, what is the probability $P(G|X=x)$ or $P(R|X=x)$ that a sample belongs to one or the other class ?
From here, I suspect that: $$P(G|X=x) = \frac{p_G(x)}{p_G(x)+p_R(x)}$$ But how can it be proved formally ?
