Halmos' "Naive Set Theory" - Exercise on Equivalence Classes In Section 7 of Halmos' "Naive Set Theory" the following exercise is proposed:

Exercise: show that $X/R$ [that is, the collection of the equivalence classes of elements of $X$ with respect to the equivalence relation $R$ in $X$] is indeed a set by exhibiting a condition that specifies exactly the subset $X/R$ of the power-set $\mathcal{P}(X)$.

My attempt
Up to this point in the book, a set can be constructed only by applying one of the following Axioms: Specification, Pairing, Union, Powers. Therefore it seems clear to me that given the set $X$ and the equivalence relation $R$ in it, we first construct the power-set $\mathcal{P}(X)$ by applying the Axiom of Powers, then we extract $X/R$ by applying the Axiom of Specification in the following manner:
$$ X/R = \{Y\in\mathcal{P}(X)-\{\emptyset\}: [\exists x \in X:(\forall y \in Y, (x, y) \in R)]\}$$
in which we have an embedding set (namely $\mathcal{P}(X)-{\emptyset}$) and the specifying condition contains $Y$ as a "free variable" (it appears at least once without being preceded by a quantifier).
Edit
As pointed out in the comments, the above specification is not right. Therefore I changed it into:
$$ A = \{Y\in\mathcal{P}(X): [\exists x \in X:(y \in Y \iff (x,y) \in R)]\}$$
Now, we need to show that $A = X/R$.
In order to do so, we shall prove that if $Y \in A$ and $x \in Y$, then $Y = x/R$ (that is, $Y$ is the equivalence class of $x \in X$ modulo $R$). In fact, suppose $y \in Y$, then $(x, y) \in R$, hence $y \in x/R$ and, viceversa, suppose $y \in x/R$, then $(x, y) \in R$, hence $y \in Y$.
Since from this it is clear that $A \subseteq X/R$, it suffices to show that if $Y \in X/R$, then $Y \in A$. In fact, $Y \in X/R$ implies that $Y$ is the equivalence class of some $x \in X$ modulo $R$, hence there exists $x \in X$ such that $x \in Y$ (by the Reflexivity of $R$) and such that $Y$ contains exactly the elements to which $x$ stands in relation. Therefore, $Y \in A$.
Thus, the proof is concluded.
 A: Let us take a Simple Example to use through out this Answer.
$X=\{1,2,3,4,5,6,7,8,9\}$
We want Equivalence Classes MOD 3, that is we want ONLY valid $A=\{\{1,4,7\},\{2,5,8\},\{3,6,9\}\}$ & nothing else.
This $A$ has these Properties:
(P1) The union of the elements is X
(P2) The elements of A are Disjoint
(P3) Each Class is available in only 1 element of A and not in other elements of A
(P4) Each element of A contains only 1 Class & no other elements of X
Let us look at some invalid Cases, with the reasons:
$W1=\{\{1,4,7\},\{3,6,9\}\}$ : One Class is missing or union is not X [[ P1 ]]
$W2=\{\{1,4,7\},\{1,4,7,2,5,8\},\{3,6,9\}\}$ The Classes are not Disjoint & Class occurs in 2 elements [[ P2 & P3 ]]
$W3=\{\{1,4,7,2,5,8\},\{3,6,9\}\}$ : Two Classes are merged [[ P3 & P4 ]]
$W4=\{\{1,4,7,2,5,8,3,6,9\}\}$ : All Classes are merged [[ P3 & P4 ]]
$W5=\{\{1,4,7,3,6\},\{2,5,8,9\},\{3,6,9\}\}$ : Some Classes have extra elements [[ P4 ]]
$W6=\{\{1,4,7\},\{3,6,9\},\{1,4,7,3,6,9\}\}$ : Not All Classes are there but we have extra elements [[ P1 P2 P3 & P4 ]]
Here are one way we can eventually get the necessary Specification, using Power Set of Power Set :
$A = \{Y \in P(P(X)) :  \\
\ \ \ \ \forall x \in X : (\exists y \in Y : x \in y)  \\
\ \ \ \ \}$
This satisfies P1 , by claiming that every element is X is there somewhere in some element of Y. This eliminates W1 & W2 but not W2 & W3 & W4 & W5.
$A = \{Y \in P(P(X)) :  \\
\ \ \ \ \forall x \in X : (\exists y \in Y : x \in y) \land  \\
\ \ \ \ \forall x \in X : (\forall y,z \in Y : (x \in y \land x \in z \implies y = z))  \\
\ \ \ \ \}$
This satisfies P1 & P2 by claiming that when some element occurs in y & z, then y & z must be same. This eliminates W1 & W2 & W5 & W6 but not W3 & W4.
$A = \{Y \in P(P(X)) :  \\
\ \ \ \ \forall x \in X : (\exists y \in Y : x \in y) \land  \\
\ \ \ \ \forall x \in X : (\forall y,z \in Y : (x \in y \land x \in z \implies y = z)) \land  \\
\ \ \ \ \forall y \in Y : (\forall u,v \in y : (uRv))  \\
\ \ \ \ \}$
This satisfies P1 & P2 & P3 by claiming that when two u,v elements occur in y, then u,v must be in the relation R. This eliminates W1 & W2 & W3 & W4 & W5 & W6.
$A = \{Y \in P(P(X)) :  \\
\ \ \ \ \forall x \in X : (\exists y \in Y : x \in y) \land  \\
\ \ \ \ \forall x \in X : (\forall y,z \in Y : (x \in y \land x \in z \implies y = z)) \land  \\
\ \ \ \ \forall y \in Y : (\forall u,v \in y : (uRv)) \land  \\
\ \ \ \ \forall y,z \in Y : (\exists u \in y , \exists v \in z : (uRv)) \implies y = z \\
\ \ \ \ \}$
This satisfies P1 & P2 & P3 & P4 by claiming that when two related u,v elements occur in y,z then y=z. This eliminates W1 & W2 & W3 & W4 & W5 & W6.
We have thus eventually got the required Specification.
In this MODULO 3 Example, I am not able to make some Invalid Case which goes through P1 & P2 & P3 but not through P4.
It may be the P4 can be Proved via P1 + P2 + P3 in which case we can simplify the Specification. I am listing it, assuming it may be necessary.
