Prove or give a counter example: for probability space $<\Omega, P>$, where event A belongs to $\Omega$, $E[X_A] = P(A)$ 
Prove or give a counter example: for probability space $<\Omega, P>$, where event $A \subseteq \Omega$
$ E[X_A] = P(A)$, where X_A is an indicator variable of A

I'd appreciate a hint to better to understand this question and how to solve it.
I understand $X_A$ will take either 0 or 1, but not understanding how (or not) the expectation of it is equal to the probability of A?
 A: HINT
$X_A$ takes the value $1$ precisely $\dfrac{\mathbb{1}(A)}{\mathbb{1}(A+A^c)}=P(A)$ of the time. The rest of the time it takes the value $0$.
A: The indicator $X_A$ takes value $1$ or $0$ depending on whether or not the event $A$ happens, so by definition of expectation we have:
$$E(X_A) = 1\cdot P(A) + 0 \cdot P(\bar A) = P(A)$$
A: I dislike title of your question ("prove or give a counterexample..."). This because definitions cannot be proved.
Measure $P$ is by nature a function on measurable sets. Every measure induces a unique integral which can be looked at as a function on measurable functions. By constructing this integral we start by defining it for non-negative measurable stepfunctions. If $Y:\Omega\to\mathbb R$ is measurable and takes values in finite set $\{a_1,\dots,a_n\}\subseteq[0,\infty)$ then we can write it as: $$Y=a_11_{A_1}+\cdots a_n1_{A_n}$$ where the $A_i$ are measurable disjoint sets with $\Omega=\bigcup_{i=1}^nA_i$. Then by definition:$$\int Y(\omega)P(d\omega)=\sum_{i=1}^n a_iP(A_i)$$
The LHS of this can also be denoted as $\mathbb EY$ and is the so-called expectation of $Y$.
Applying that in your case gives us $n=2,a_1=1,a_2=0,A_1=A,A_2=\Omega\setminus A$ and it follows directly that by definition:$$\mathbb EX_A=1P(A)+0P(A^c)=P(A)$$ 
So actually there is nothing to "prove" or "solve" here.

Yes, it is tempting to fall back on a proof like: if rv $X$ only takes values in $\{0,1\}$ and this with $P(X=1)=1$ then $\mathbb EX=1\cdot p+0\cdot(1-p)=p$ but then actually you are appealing to a consequence of the definition (not the definition itself) in order to prove that definition (while definitions cannot be proved). That's the world upside down.
