How is $E[c(X)|X] = c(X)$ derived? I understand that this is a property of conditional expectation, but I am not too clear on how it is derived.
 A: To understand the "derivation" of this rule, you need to look at the formal definition of conditional expectation, which is actually defined directly by its integral equation (see similar answer here).  The rule in your question is a trivial consequence of the definition.   Given some measureable function $c:\mathscr{X}\rightarrow \mathbb{R}$, a valid conditional expectation $g(X) \equiv \mathbb{E}(c(X)|X)$ is any measureable function $g:\mathscr{X}\rightarrow \mathbb{R}$ that satisfies the equation:
$$\int \limits_\mathscr{X} g(x) \ dF_X(x) = \int \limits_\mathscr{X} c(x) \ dF_X(x).$$
Any measureable function $g$ that satisfies this equation is considered to be a valid conditional expectation.  Clearly, the function $g=c$ satisfies this equation, so we can say that:
$$c(X) = g(X) = \mathbb{E}(c(X)|X).$$
This rule says that we can "take out what is known"; it is a trivial consequence of the underlying definition of conditional probability.  (There may be other valid conditional expectations, but they will all be equivalent to this one, except on a set with probability zero.  For this reason, we tend to think of $c(X)$ as "the" conditional expectation in this case.  This is a reasonable shorthand for the more formally correct statement.)  
A: I will complement the technical answer with an intuitive one. $E[c(X)|X]$ means expected value of $c(X)$ (a function of a random variable $X$) given $X$ (that is, given a particular value of $X$ has been observed). Since $X$ has been observed, so has $c(X)$, and its expected value is just its observed value. Therefore, $E[c(X)|X]=c(X)$
