Theorem:
Let $P$ be a partition of a set $S$, and let $a$ and $b$ be $\in S$. Define the relation $R$ on $S$ as follows: $aRb$ iff there exists an $X \in P$ such that $a \in X$ and $b \in X$. Then $R$ is an equivalence relation on $S$. Furthermore, the set of equivalence classes of $R$ is equal to $P = \{[a]: a \in S\}$.
Proof for the bolded part:
Let $a \in S$. Then there exists an $X \in P$ such that $a \in X$.
$[a] = \{x: aRx\} = X$
So, the set of all equivalence classes of the relation R is the original partition: $P = \{[a]: a \in S\}$
Is the proof excerpt above saying this:
Let $a \in S$. Then there exists an $X \in P$ such that $a \in X$. So, $P =\{X: a \in X\}$. Thus $[a] = \{x: aRx\} = X$. Therefore $P = \{[a]: a \in S\}$.
Your statement $P = \{X\ :\ a\in X\}$ is not correct. $P$ is the set of all elements of the partition, while $\{X\ :\ a\in X\}$ consists only of that element of the partition containing $a$.
The portion of the proof you quoted is saying this: choose $a\in S$; then there is a $X\in P$ such that $a\in X$. By definition of $R$, $[a] = \{b\in S\ |\ b\sim a\} = \{b\in S\ |\ b\in X\} = X$. So each equivalence class of $R$ is a member of the partition $P$. Conversely, each member of the partition is an equivalence class; to see this, let $X\in P$ and choose $a\in X$. Then $[a] = X\in P$.