Goodness of discrete approximation I am given a function $f: R \times R \to R$ and a random variable $Y$ for which all finite moments exist.
Suppose that $Y$ is a discrete random variable and it takes values $\mu_i$ with probability $p_i$. $X$ is a random variable which is independent of $Y$
Then I think it is correct to say that $\mathbb{E}(f(X,Y)|X=x)$ = $\sum_{i=1}^np_if(x,\mu_i)$
I want to use the same approximation when $Y$ is continuous.
I want to approximate $\mathbb{E}(f(X,Y)|X=x)$ which is a function of $x$ with another function which is written as a finite sum $\sum_{i=1}^np_if(x,\mu_i)$.  
I want to prove that as $n \to \infty$ $\sum_{i=1}^np_if(x,\mu_i)$ converges to $\mathbb{E}(f(X,Y)|X=x)$
By convergence I mean $\lim_{n \to \infty}$ $\int_{x \in A} (\mathbb{E}(f(X,Y)|X=x) - \sum_{i=1}^np_if(x,\mu_i))^2 \to 0$ 
I am fine not knowing what $\mu_i$ and $p_i$ look like, the existence is fine for me.  But I would expect $\mu_i$ to be from the set of possible values of $Y$. And I would expect $p_i$ to be positive and $\sum p_i = 1$. Just like in the discrete case. Am I asking for too much?
I have some ideas how to prove that If $Y$ has bounded support. We can divide it into intervals of equal length, set $\mu_i$ as midpoints of the interval, $p_i$ as density of each interval. The more intervals we make, the better should be approximation. 
However I have no idea how to proceed if Y has unbounded support. Probably I can still approximate unbounded support with bounded one, because probability density should be diminishing at the ends of support. I would be very grateful for any help. Also feel free to impose any regularity conditions on $f$ like smoothness, continuity etc.
P.S If $L^2$ convergence seems too much, feel free to use any other reasonable convergence concept
 A: Seeing as $X$ is not a random variable, If I understand the question correctly, we're looking for an approximation for $$\mathbb{E}[f(x,Y)]$$ of the given form, where $x \in \mathbb{R}$ (I don't see why we should need to talk about $X$ at all).

Suppose that $f(x,\cdot)$ is uniformly continuous for each $x \in \mathbb{R}$. Let $F: \mathbb{R} \rightarrow [0,1]$ be the distribution function of $Y$ and denote its generalized inverse by $F^{-1}$. Note that $F^{-1}$ is a continuous function on a compact domain and hence uniformly continuous. For $n \in \mathbb{N}$, set 
$$ \mu_{i}^{(n)} := F^{-1}\left(\frac{i}{n}\right), \quad p_i^{(n)} := \frac{1}{n}, \quad i=0,\dots,n.$$ 
Then, it holds that
$$ \lim_{n\to\infty} \frac{1}{n} \sum_{i=1}^{n} f(x,\mu_{i}^{(n)} ) = \mathbb{E}[f(x,Y)], \quad x \in \mathbb{R}.$$ 
To see this, we split up the expectation
$$\mathbb{E}[f(x,Y)] = \mathbb{E}\left[\sum_{i=1}^{n} 1_{[\mu_{i-1}^{(n)},\mu_i^{(n)}]}(Y) f(x,Y)\right].$$
This yields
$$\frac{1}{n} \sum_{i=1}^{n} f(x,\mu_{i}^{(n)} ) - \mathbb{E}[f(x,Y)] =  \mathbb{E}\left[\frac{1}{n}\sum_{i=1}^{n} f(x,\mu_{i}^{(n)} ) - \sum_{i=1}^{n} 1_{[\mu_{i-1}^{(n)},\mu_i^{(n)}]}(Y) f(x,Y)\right].$$
Note that $\mathbb{E}\left[ 1_{[\mu_{i-1}^{(n)},\mu_i^{(n)}]}(Y)\right] = \frac{1}{n}$, so we have
$$
\mathbb{E}\left[\frac{1}{n}\sum_{i=1}^{n} f(x,\mu_{i}^{(n)} ) \right] = \mathbb{E}\left[\sum_{i=1}^{n} 1_{[\mu_{i-1}^{(n)},\mu_i^{(n)}]}(Y)f(x,\mu_i^{(n)})\right].
$$
This leads to
$$\frac{1}{n} \sum_{i=1}^{n} f(x,\mu_{i}^{(n)} ) - \mathbb{E}[f(x,Y)] = \mathbb{E}\left[\sum_{i=1}^{n} 1_{[\mu_{i-1}^{(n)},\mu_i^{(n)}]}(Y)\left(f(x,\mu_i^{(n)}) - f(x,Y)\right)\right].$$
As $f(x,\cdot)$ and $F^{-1}$ are uniformly continuous, for any $\epsilon > 0$ we have for $n$ large enough that $$\sup_{y \in [\mu_{i-1}^{(n)},\mu_{i}^{(n)}]} |f(x,\mu_i^{(n)}) - f(x,y)| < \epsilon, \quad i=0,\dots,n.$$
In which case
$$\left|\frac{1}{n} \sum_{i=1}^{n} f(x,\mu_{i}^{(n)} ) - \mathbb{E}[f(x,Y)]\right| < \mathbb{E}\left[\sum_{i=1}^{n} 1_{[\mu_{i-1}^{(n)},\mu_i^{(n)}]}(Y)\cdot \epsilon\right] = \epsilon. $$ 

If in addition, we assume that there is $g \in L^2(\mathbb{R})$ such that $|f(x,y)| \leq g(x)$ for all $y \in \mathbb{R}$, we also obtain $L^2$-convergence by the dominated convergence theorem.
