Forming conditional probabilities/densities from a continuous distribution Suppose that $X\sim U[0,1]$. I am trying to understand how to derive probability/density of some realization $x \in [0,1]$ conditional on $x \in E\subseteq[0,1]$. The more I think about it, the more I seem to be confused. Any help would be welcome.
1) If $Pr(X\in E)>0$, the density seems to be $f_X(x|X \in E)=\frac{f_X(x)}{Pr(X\in E)} $. So for example we can calculate $f_X(x|X \leq 1/2)=\frac{f_X(x)}{1/2}=2f_X(x)=2 $.
So far so good. Now suppose that $Pr(X\in E)=0$.
2) For example $E=\{1/4, 3/4 \}$. It seems intuitive that the probability of $X=1/$4 is given by
$$
Pr(X=1/4|X \in E)=\frac{f_X(1/4)}{f_X(1/4)+f_X(3/4)}=1/2.
$$
Is this correct? It feels intuitive, but I am not convinced we can use densities in this way to obtain probabilities. If it is correct, can you point me to a more formal explanation of why it works? Also, is it true that for any finite $E$ it holds
$$
Pr(X=x|X \in E)=\frac{f_X(x)}{\sum_{y\in E} f_X(y)}?
$$
3) Now let $E= \{y \in [0,1]: y \in \mathbb{Q} \}$, i.e. $y$ is a rational number. There are infinitely many rational numbers in the unit interval. What is $Pr(X=x|X\in E)$? Intuition suggests that $Pr(X=x|X\in E)=0$. Also, proceeding as in 2) gives $\sum_{y\in E} f_X(y)=\infty$, so that $Pr(X=x|X\in E)=0$. If it is indeed true that $Pr(X=x|X\in E)=0$, would it be possible to calculate the conditional density of $X$, i.e. $f_X(x|X \in E)$? Approach as in 1) doesn't work since $Pr(X=x|X\in E)=0$.
 A: So let $X$ is uniformly distributed over $[0,1]$. Your correct question is as follows: How to express in the language of probability the following intuitive clear question: "What is the probability that $X=\frac{1}{4}$ assuming that either $X=\frac{1}{2}$ or $X=\frac{1}{4}$?" And the intuitive clear answer: "$\frac{1}{2}.$"

The pdf, by definition is a function whose integral over an interval gives the probability of the event that the corresponding random variable falls in the set in question. So for instance
$$P(\frac{1}{2}\le X\le \frac{1}{2}+\Delta x )=\int_{\frac{1}{2}}^{\frac{1}{2}+\Delta x}\ dx = \Delta x.$$

Your specific question can be formulated then the following way
$$P(\frac{1}{4}\le X<\frac{1}{4}+\Delta x \mid \frac{1}{4}\le X<\frac{1}{4}+\Delta x \cup \frac{1}{2}\le X<\frac{1}{4}+\Delta x )=?$$
Based on the definition of the conditional probability we have 
$$\frac{P(\frac{1}{4}\le X<\frac{1}{4}+\Delta x \cap \frac{1}{4}\le X<\frac{1}{4}+\Delta x \cup \frac{1}{2}\le X<\frac{1}{4}+\Delta x )}{P(\frac{1}{4}\le X<\frac{1}{4}+\Delta x \cup \frac{1}{2}\le X<\frac{1}{4}+\Delta x)}=?$$
If $\Delta x$ is small enough then the question is
 $$\frac{P(\frac{1}{4}\le X<\frac{1}{4}+\Delta x)}{P(\frac{1}{4}\le X<\frac{1}{4}+\Delta x)+P(\frac{1}{2}\le X<\frac{1}{4}+\Delta x)}=?$$

Using the definition of the probability density we have
$$\frac{P(\frac{1}{4}\le X<\frac{1}{4}+\Delta x)}{P(\frac{1}{4}\le X<\frac{1}{4}+\Delta x)+P(\frac{1}{2}\le X<\frac{1}{4}+\Delta x)}=\frac{\Delta x}{2\Delta x}=\frac{1}{2}.$$

This argumentation can be generalized for the the case when $f_X$, the df of $X$ exists and when $E=\{x_1,x_2,\cdots,x_n\}$, and $P(X\in E)>0)$, and $x_k \in E$ and $\Delta x$ is small enough then
$$P(x_k<X<x_k+\Delta x \mid X\in E)=\frac{P(x_k<X<x_k+\Delta x)}{\sum_{i=1}^n P(x_i<X<x_i+\Delta x)}=$$
$$\approx\frac{f(x_k)\Delta x}{ \sum_{i=1}^n f(x_i)\Delta x}=\frac{f(x_k)}{ \sum_{i=1}^n f(x_i)}.$$

Now, what if $E$ is the set of rational numbers? If we assume the existence of the pdf then $P(X=q)=0$ for all rationals. (The countable sum of these zeros is also $0$.) So we cannot derive the conclusion above. (As it was observed by the OP.) 

However, if we don't assume the existence of the pdf then we can have a similar result. Let $\{q_i\}$ is an ordered sequence of the rationals and let $p_i=P(X=q_i)$ such that $\sum p_i=1$.  Now if $E$ is a subset of rationals and $\sum_{q_i\in E}p_i>0$ then
$$P(X=x_k \mid X\in E)=\begin{cases}0,& \text{ if } x_k \notin E\\
\frac{p_k}{\sum_{x_i \in E}},& \text{ otherwise.}\end{cases}$$
The distribution over the rationals cannot be uniform. This is the speck on the face of  classical probability theory.
A: If $P(x \in E) = 0$, then the conditional density $f(x|x \in E)$ is undefined because it would involve division by zero.
One can even make up an example of this kind of situation for a discrete density. Suppose an
urn contains 2 red balls, 3 green balls, and no white balls.
You can find the conditional probability that the second
ball is green given that the first is red. But it doesn't
make sense to ask for the conditional probability that the
second ball is green given that the first is white.
In some bivariate cases (maybe later on in your course) you 
may have a jointly continuous density $f(x, y)$ and ask for
the conditional distribution $f(x|Y = y).$ Then $P(Y = y) = 0,$
but if you can interpret $f(x|Y = y)$ in terms of a limit
in which the denominator is $P[Y \in (y-\epsilon_1,y+\epsilon_2)],$
as $\epsilon_i \rightarrow 0,$ then the conditional distribution
may make sense. (The limit has to be unambiguous.)
