Every quasi component is closed 
Let $X$ be a Topological Space. A discrete-valued map is a map $f:X\rightarrow D$ where $D$ is a discrete space. Define an equivalence relation on $X$ such that $x\simeq y$ if and only if $f(x)=f(y)$ for every discrete-valued map. Prove that every equivalence class (called quasi-component) is closed.

I am not sure about how to proceed to the proof. I though that, on the equivalence class, every map is constat so if I call $C$ the quasi-component, $C$ is a connected subspace of $X$. But I don't know how to proceed to prove that $C$ is closed. Maybe every quasi component is a connected component?
Can someone help me? Thanks before!
 A: There are various definitions of the concept of a quasi-component of a space $X$. In my opinion the "standard definition" is this:

Write $x \sim y$ if each clopen (= simultaneously closed and open) subset of $X$ either contains both $x,y$ or none of $x,y$. It is easy to verify that $\sim$ is an equivalence relation on $X$. The equivalence classes with respect to $\sim$ are called the quasi-components of $X$.

It is an immediate consequence of this definition that the quasi-component $Q(x)$ of a point $x \in X$ is the intersection of all clopen subsets of $X$ containing $x$. Therefore all quasi-components are closed.
Let us now verify that the above equivalence relation $\sim$ agrees with the equivalence relation $\simeq$ in your question.

*

*Let $x \sim y$ and let $f : X \to D$ be a discrete-valued map. Let $d = f(x)$. The preimage $f^{-1}(d)$ is a clopen subset of $X$ containing $x$. Thus we get $y \in f^{-1}(d)$, i.e. $f(y) = d = f(x)$. This proves $x \simeq y$.


*Let $x \simeq y$ and let $M$ be a clopen subset of $X$ containing one of $x,y$, w.lo.g. $x$. The set $N = X \setminus M$ is also clopen. Let $D = \{0,1\}$ be the discrete space with two points. The map $f : X \to D, f(z) = 0$ for $z \in M$ and $f(z) = 1$ for $z \in N$ is continuous. We have $f(x) = 0$, thus also $f(y) = 0$, i.e. $y \in M$. This proves $x \sim y$.
A: A direct proof: let $C$ be a non-empty quasicomponent and $x \in \overline{C}$.
To see that $x$ belongs to that same quasicomponent, consider any continuous $f: X \to D$ where $D$ is discrete.
By continuity of $f$:
$$f(x) \in f[\overline{C}] \subseteq \overline{f[C]}=f[C]$$ the latter as the codomain is discrete. As $C$ is a quasicomponent, $f[C]$ is a singleton, say $\{d\}$, and so $f(x)$ is that same value too. So $x$ belongs to same $C$ and we're done.
