Expectation & Conditional Expectation
1) "Let g be any function of the random variable X.
Then the expected value E[g(X)|X]=g(X)"
I don't understand why. I tried to use the definition of conditional expectation to prove it, but it doesn't seem to work...
2) "If X is non-negative, then E(X) = Integral(0 to infinity) of (1-F(x))dx, where F(x) is the cumulative distribution function of X."
[Aside: the source that I quote this from says that the above is true no matter X is discrete or continuous. But if X is discrete, how can E(X) have an integral in it? It doesn't make much intuive sense to me...]
I tried integration by parts (letting u = 1 - F(x), dv=dx) and I think I am done if I can prove that
lim x(1-F(x)) = 0
But this actually gives "infinity times 0" which is an indeterminate form and requires L'Hopital's Rule. I tried many different ways but was still unable to figure out what the limit is going to be...how can we prove that the limit is equal to 0?
Thanks for any help!