The typical topologist's sine curve $S$ contains a range on the $y$-axis and the function $\sin(1/x)$,
\begin{equation}\label{1}\tag{1} X = \{(0,y)| -1 \leq y \leq 1 \}, \quad Y = \{(x, \sin (1/x))| x>0\} \end{equation}
I want to modify this a bit by changing the range of $X$ to $-1 < y < 1$ so that,
\begin{equation}\label{2}\tag{2} X = \{(0,y)| -1 < y < 1 \}, \quad Y = \{(x, \sin (1/x))| x>0\} \end{equation}
Intuitively, we might seem to think that $S$ is disconnected due to the fact that it contains sets that are disjoint $X \cap Y = \emptyset$. However, the definition for being connected is that, $S$ is connected only if we cannot write it as $A \cup B = S$ for some nonempty open sets $A$, $B$, and that $A \cap B = \emptyset$.
There is a proof for the connectedness of $S$ in $\eqref{1}$ which goes as follows (I'm not going to write the whole proof since that's not where my question lies): We assume (and know) that $Y$ is connected, we want to show that the closure of $Y$ labeled $\bar{Y}$ is connected. The closure $\bar{Y}$ will of course include $X$ so that $S = \bar{Y}$. Let us suppose that $\bar{Y}$ is disconnected, so there should be $A$, $B$ both nonempty open sets such that $A \cup B = \bar{Y}$ and $A \cap B = \emptyset$. The proof can be done to show in the end that either $A$ or $B$ must be empty, but this contradicts the assumption that both $A$, $B$ must be nonempty so $S = \bar{Y}$ must be connected.
The proof above involves arbitrary nonempty open sets $A$, $B$. We know that $X$ in $\eqref{1}$ is closed because it contains all of its boundary points, while $X$ in $\eqref{2}$ is neither closed nor open. Question, if we take the special case $A = X$, $B = Y$, is it correct to say that at least for this case, the condition $S = X \cup Y$ cannot be satisfied since $X$ in both cases is not open? Of course, that is why we need to show that there doesn't exist any nonempty open sets $A$, $B$ that can satisfy $A \cup B = S$ and $A \cap B = \emptyset$, not just for specific cases.
I have added $\eqref{2}$ to emphasize what I'm thinking about the arguments involving the topologist's sine curve, which involves $X$ not being open, such that whatever proof works for $\eqref{1}$ should also work for $\eqref{2}$. In other words, is it correct to say that whatever proof for the topologist's sine curve, it doesn't matter whether $-1 \leq y \leq 1$ or $-1 < y < 1$? My point is, it seems like whether the proofs for both cases will differ hinges on the fact that $X$ is not open.