If $P(X=k)=1/2^k$ for every $k\ge1$ and $h_k(x)$ converges to identity function $h(x)=x$, does $E(X|h_k(X))$ converge almost surely? $P(X=k)=1/2^k$,k=1,2,3...
$h_k(x)$ converges to identity function,i.e $h(x)=x$. The question is that whether $E(X|h_k(X))$ converges almost surely. If true, how to prove it? If not, please give an example. I think that define $Y_k=E(X|h_k(X))$, then $Y_k$ is uniformly integrable, but I don't know how to continue with that. I think $Y_k$ converges in $L^1$.
 A: Since $X$ is integer valued, only the values of $h_k$ at the integers are relevant. For every $k$, consider the partition $(A_i^k)_i$ of $\mathbb N$ induced by the equivalence relation 
$$
n\sim_k m\iff h_k(n)=h_k(m).
$$
Then $Y_k=E[X\mid h_k(X)]$ is 
$$
Y_k=\sum\limits_iE[X\mid X\in A_i^k]\cdot\mathbf 1_{A_i^k}(X).
$$
Fix some $n$ in $\mathbb N$ such that $P[X=n]\ne0$. For every $k$, on the event $[X=n]$, 
$$
Y_k=E[X\mid X\in A_{i(n,k)}^k],
$$ 
where $i(n,k)=j$ is defined by the condition that $n$ is in $A_j^k$. Thus, the question of the almost sure convergence of $Y_k$ reduces to showing that, for each $n$ such that $P[X=n]\ne0$, 
$$E[X\mid X\in A_{i(n,k)}^k]\to n\quad\text{when}\quad k\to\infty.
$$
To show this, note that, for every $m\ne n$, $h_k(m)\ne h_k(n)$ for every $k$ large enough (this is the only step using the condition thet $h_k(x)\to x$ for every $x$, and one sees that one does not use the full condition) hence $m$ is not in $A_{i(n,k)}^k$ for every $k$ large enough. 
For every $M$, choose some $K_M$ such that, for every $k\geqslant K_M$, $A_{i(n,k)}^k$ contains no $m\leqslant M$, $m\ne n$. Let $k\geqslant K_M$. Then, 
$$
\{n\}\subseteq A_{i(n,k)}^k\subseteq\{n\}\cup\{M+1,M+2,\ldots\},
$$ 
hence
$$
P[X=n]\leqslant P[X\in A_{i(n,k)}^k]\leqslant P[X=n]+P[X\gt M],
$$
and
$$
nP[X=n]\leqslant E[X;X\in A_{i(n,k)}^k]\leqslant nP[X=n]+E[X;X\gt M].
$$
This implies
$$
\frac{nP[X=n]}{P[X=n]+P[X\gt M]}\leqslant E[X\mid X\in A_{i(n,k)}^k]\leqslant\frac{nP[X=n]+E[X;X\gt M]}{P[X=n]},
$$
that is,
$$
-\frac{nP[X\gt M]}{P[X=n]+P[X\gt M]}\leqslant E[X\mid X\in A_{i(n,k)}^k]-n\leqslant\frac{E[X;X\gt M]}{P[X=n]}.
$$
Since $X$ is integrable, for every $\varepsilon\gt0$, one can choose $M$ such that $E[X;X\gt M]\leqslant\varepsilon P[X=n]$ and $P[X\gt M]\leqslant\varepsilon P[X=n]/n$, then, for every $k\geqslant K_M$,
$$
\left|E[X\mid X\in A_{i(n,k)}^k]-n\right|\leqslant\varepsilon.
$$
Finally, the result holds for every integrable and integer valued random variable $X$.
