Suppose we have an underlying set $S$ and an equivalence relation $\sim$ defined on $S$ inducing the partition $S\backslash\sim=\{[s]_{\sim}:s\in S\}$ of $S$ known as the quotient set where $[s]_{\sim}$ is the equivalence class of $s$ (non-empty since $s\in[s]_{\sim}$ always holds) so that all $t,u\in[s]_{\sim}$ satisfy $t\sim u$.
Clearly to me (by this I mean I suppose intuitively) $S\backslash\sim$ is a class since it's elements are sets (subsets of $S$). I struggle with the formalities of justifying $S\backslash\sim$ is a set, whereas on this site I have seen others struggling with the reverse, that is to show or justify $S\backslash\sim$ is a class: for instance a question about equivalence classes
I am not a set theorist, but do try to follow the very introductory pages of Thomas Jech (Set Theory, 2003, Springer) to keep myself vaguely aware of the axioms of ZF or ZFC, and am guessing these considerations are needed here to resolve my confusion? I am a little cavalier below in my applications of logic so please do forgive me for this, but I want to check how far off the mark I am here.
My attempt;
For all $B\in S\backslash\sim$ define $\psi(B)$ to take the value 1 if all pairs $s,t\in B$ satisfy $s\sim t$ and all points $u\in S\backslash B$ satisfy $u\not\sim s$ for all $s\in B$, and zero if not. I think this definition ensures $B\in S\backslash\sim$ if and only if $\psi(B)=1$ . Then according to Jech $\mathcal{C}$ is a class;
$$\mathcal{C}:=\{X:\psi(X)\}$$
I am guessing this means all members $X$ of $\mathcal{C}$ satisfy $\psi(X)=1$ but for some reason this was not specified (maybe too obvious, although it does not seem too much effort to do this for clarity). Furthermore I have made $X$ as uppercase since I am obsessed with making it clear when $X$ is a set or $x$ is an element of a set, but I see many set theorists don't seem to bother with this (which does not help me at all). Note that $X$ in the definition of $\mathcal{C}$ seems to come "from nowhere", i.e. I would be tempted to write
$$\mathcal{C}:=\{X\subseteq S:\psi(X)\}$$
I am vaguely aware this change might be a big deal, that is assuming there is some "parent set" from which to draw elements from (in Russell's paradox and the set of all sets this concept seems to be crucial?). In the above I am intending $\phi$ to be a property without parameters, but again Jech is rather vague so I am doing this intuitively. Finally the so called "schema of separation" axiom states that $Y$ defined below is a set if $\phi$ is a property;
$$Y=\{u\in X:\psi(u)\}$$
I am lost here as to whether $X$ is a set or a class since I would write the set $Y$ exists if $\phi$ is a property and $X$ is a class;
$$Y=\{B\in X:\psi(B)=1\}$$
So my question is essentially is $Y=S\backslash \sim$ the justification for $S\backslash \sim$ being a set?
SOME EDITS: In response to comments I use the schema of replacement. I also refine/update my first attempt at defining a property $\psi$. To summarise I think I have shown the quotient set $S\backslash \sim$ is both a class and a set in the "proper" set theory world of ZFC?
Intuitively I was always happy $S\backslash \sim$ is a class but did not realise I had to justify this when using axiomatic set theory (ZFC has only sets). Given I am now aware of the axioms a little more, I am still surprised how difficult it is to show $S\backslash \sim$ is a set (if we start from the premise it is a class).
Appreciate any further corrections/insights from the set theorists out there.
Binary relations as function
For clarity of notation write $S\backslash \sim = S_{\sim}$. Define
\begin{align} \phi_{\sim}:\hspace{5pt}S&\longrightarrow S_{\sim}\\ \phi_{\sim}(s)&\mapsto [s]_{\sim} \end{align}
Now $\phi_{\sim}:S\longrightarrow S_{\sim}$ is a function if $\phi_{\sim}(s)=f(t)$ holds whenever $s=t$, or equivalently as per Jech p11 if $R_{\phi_{\sim}}$ is a binary relation on $S\times S_{\sim}$ then $R_{\phi_{\sim}}$ is a function if $(s,B),(s,C)\in R$ imply $B=C$.
The following $R_{\phi_{\sim}}$
\begin{align*} R_{\phi_{\sim}}=\left\{(s,B)\in S\times S_{\sim}:\phi_{\sim}(s)=B\right\} \end{align*}
is a function because it satisfies $(s,B),(s,C)\in R_{\phi_{\sim}}$ implies $B=C$: since $B,C\in S_{\sim}$ then $B=[b]_{\sim}$ and $C=[c]_{\sim}$ for some $b,c\in S$ and hence $(s,B),(s,C)\in R_{\phi_{\sim}}$ implies $\phi_{\sim}(s)=[b]_{\sim}$ and $\phi_{\sim}(s)=[c]_{\sim}$. But $s\in [s]_{\sim}$ and so $\phi_{\sim}(s)=[s]_{\sim}$. Thus $[s]_{\sim}=[b]_{\sim}=[c]_{\sim}$ holds, or equivalently $[s]_{\sim}=B=C$.
Jech (2003) calls the more familiar (to me anyway) mapping notation $\phi$ the "standard" notation which are obviously linked in the following way;
\begin{align*} \forall (s,B)\in S\times S_{\sim}:\hspace{10pt}(s,B)\in R_{\phi_{\sim}}\Longleftrightarrow \phi_{\sim}(s)=B \end{align*}
The quotient set as a class using properties in ZFC?
Firstly redefining the property $\psi$;
\begin{align*} \psi(X)=1\Longleftrightarrow \forall x\in X: (x,B)\in R_{\phi_{\sim}}\text{ some }B\in S_{\sim} \end{align*}
For any $X\subseteq S$ this property states $\psi(X)=1$ if and only if $\phi(x)=B$ for all $x\in X$ for some $B\in S_{\tau}$ (equivalently $\phi_{\sim}(x)=B$ for all $x\in B$ for some $B\in S_{\tau}$).
Then from page 5 of Jech, $\mathcal{C}$ is the class of all sets with $\psi(X)=1$
$$\mathcal{C}:=\{X:\psi(X)\}$$
I am not sure where the sets $X$ are drawn from (I am tempted to write $X\in 2^{S}$ but I sense not saying this is important rather than just more compact?)
$S_{\sim}=\mathcal{C}$;
Choose any $X\in\mathcal{C}$. Then $\phi_{\sim}(x)=B$ for all $x\in B$ for some $B\in S_{\tau}$. Suppose $s\in B$ for some $s\in S$. Then $\phi_{\sim}(x)=[s]_{\sim}$ for all $x\in B$ for some $[s]_{\sim}\in S_{\tau}$ implying $X\subseteq [s]_{\sim}$. Now choose any $x\in[s]_{\sim}$, meaning $\phi_{\sim}(x)=[s]_{\sim}$ is true implying $(x,[s]_{\phi})\in R_{\phi_{\sim}}$. Since this holds for all $x\in [s]_{\phi}$ we have $\psi([s]_{\phi})=1$ and thus $[s]_{\sim}\subseteq X$. Conclude $X=[s]_{\sim}$ and hence that $\mathcal{C}\subseteq S_{\sim}$ is true.
Conversely choose $[s]_{\phi}\in S_{\sim}$ which means for all $t\in[s]_{\phi}$ that $\phi_{\sim}(t)=[s]_{\phi}$, or equivalently $(t,[s]_{\phi})\in R_{\phi}$, and hence $\psi([s]_{\phi})=1$ must hold, which implies $[s]_{\phi}\in\mathcal{C}$. Thus $S_{\sim}\subseteq\mathcal{C}$ is true, implying $S_{\sim}=\mathcal{C}$.
Thus $S_{\sim}$ is a class?
Axiom Schema of Replacement
Define the 1-1 function $F:S_{\sim}\longrightarrow S_{\sim}$, $F([s]_{\sim})\mapsto [s]_{\sim}$ and the binary relation $R_{F}$
$$R_{F}=\left\{A\times B\in S_{\sim}\times S_{\sim}:F(A)\mapsto A \right\}$$
Then the injective nature of $F$ ensures $(A,B),(A,C)\in R_{F}$ imply $B=C=A$ and hence $R_{F}$ is a function (obviously the identity function) consisting of the cross products $[s]_{\sim}\times [s]_{\sim}$.
By the schema of replacement since $R_{F}$ is a function there exists a set $Y$
$$Y=\{B:(B,B)\in R_{F}\}=\{F(B):B\in S_{\sim}\}$$
Since $[s]_{\sim}\in S_{\sim}$ satisfies $([s]_{\sim},[s]_{\sim})\in R_{F}$ then $[s]_{\sim}\in Y$ and hence $S_{\sim}\subseteq Y$. Conversely $B\in Y$ satisfies $F(B)=B$ and $B\in S_{\sim}$, hence $Y\subseteq S_{\sim}$ and so $Y= S_{\sim}$
Thus $S_{\sim}$ is a set?