On integration of a simple random variable in measure theory. Suppose we have a simple Random variable $X$ defined on a probability space $(\Omega, F, P)$. A random variable is simple if $X(\Omega) = \{ \alpha_1, \ldots , \alpha_n \}$.
We define the integral of a simple random variable to be: 
$$\int_{\Omega}X\,dP = \sum_{k=1}^n \alpha_k P(X = \alpha_k) $$
The book I am utilizing then states that we have this result:
$$\int_{\Omega}f(X)\,dP = \sum_{k=1}^n f(\alpha_k) P(X = \alpha_k) = \sum_{k=1}^n f(\alpha_k) P^X(f = f(\alpha_k)) = \int_R f \, dP^X$$
$P^X$ is defined to be $P(X^{-1}(H))$ for $H \in B$ where B is the Borel sigma algebra. Notationally we write $P(X^{-1}(H)) = P(X \in H)$.
I do not see why $ P(X = \alpha_k) = P^X(f = f(\alpha_k)) $
What I would write is $$ \int_{\Omega}f(X)\,dP  = \sum_{k=1}^n f(\alpha_k) P(f(X) = f(\alpha_k)) = \sum_{k=1}^n f(\alpha_k) P(X = \alpha_k) = \sum_{k=1}^n f(\alpha_k)P(X^{-1}(\alpha_k)) = \sum_{k=1}^n f(\alpha_k)P^X(\{\alpha_k \}) $$
and then I am stuck. I would like to ask which equalities are incorrect and why is $ P(X = \alpha_k) = P^X(f = f(\alpha_k)) $?
 A: The issue with the above proof is that $f$ is not necessarily injective.
For example, if you just take $f=1$, then
$\sum_{k=1}^n f(\alpha_k) P(f(X) = f(\alpha_k))  = \sum_{k=1}^n P \Omega = n$.

We have $X(\Omega) = \{\alpha_k\}$ with the $\alpha_k$ being distinct.
The form of the question suggests that you are in the process of defining the integral of measurable functions, so it is not immediate how you ascribe a
value to $\int f d P^X$ as $f$ is not necessarily simple, so somewhere you
must have a definition of $\int f d P^X$, at least for the case were the support of the measure is a finite set.
Since $P^X$ is supported on $\{\alpha_k\}$,
 for any measurable, real valued $g$ we have $\int g dP^X = \sum_k g(\alpha_k) P^X (\{\alpha_k\})$.
The function $\phi = f \circ X$ is simple, and we have
$\phi = \sum_k f(\alpha_k) 1_{X^{-1} \{\alpha_k\}}$, however, the $f(\alpha_k)$ may not be distinct.
We have, $\int \phi dP = \sum_k f(\alpha_k) \int 1_{X^{-1} \{\alpha_k\}} = \sum_k f(\alpha_k) P(X^{-1} \{\alpha_k\}) = \sum_k f(\alpha_k) P^X(\{\alpha_k\})$.
Comparing with the above comment, we see that
$\int \phi dP = \int f dP^X$.
Note: As an aside, the statement is true in greater generality, see, for example,
the change of variables formula (3.9) in Durrett's "Probability: Theory and Examples".
A: I'm not a mathematician, but I think the question can't be difficult, especially because $X(\Omega)$ is a finite set. 
The problem is, what is $f$? By "common sense", $E[f(X)] = \sum_i f(a_i) P(X=a_i) = \sum_j g_j P(f(X) = g_j)$. That is, because $X$ can only take on values from the set $\{\alpha_1, ..., \alpha_n\}$, $f(X)$ also forms a finite set, and $P(f(X) = g_j)$ is the probability that $f(X)$ equals $g_j$. Note that the size of $\{ g_1, ..., g_m \}$ can be smaller than the size of $\{\alpha_1, ..., \alpha_n\}$, because $f$ is not necessarily onto (??).
Indeed I think there may be something wrong with your notation. $\int_{\Omega} X dP = \sum_{k=1}^{n} a_k P(X^{-1}(a_k))$. Remember $X: \Omega \rightarrow \{\alpha_1, ..., \alpha_n\}$ and $P: \Omega \rightarrow R$. That said $\int_{\Omega} f(X) dP = \sum_{k=1}^m g_m P\left( (f \circ X)^{-1}(g_m) \right)$. The inverse in the later equation does not mean $f \circ X $ is invertible; rather it is used in the sense of "inverse sets/images".
