TITLE: Square as union of two disjoint connected sets containing opposite corners
QUESTION [5 upvotes]: Question: Given the unit square $[0,1] \times [0,1]$

Write it as the union of two disjoint connected sets $A, B$, $A$ must
  contain $(0,0),(1,1)$, $B$ must contain $(0,1), (1,0)$

Not sure if this can actually be done.
I went for the obvious solution:
Let $A = \{(x,x) | x \in [0,1]\}$, $B = ([0,1] \times [0,1]) \backslash A$. Then $A,B$ contains the desired points. $A$ is connected because it is homeomorphic to $[0,1]$, a connected space. What about the connectedness of $B$? Well, obviously it is not connected. 

What other possibility could there be?

REPLY [4 votes]: Let $f(x)=\sin(1/x)$ for $x\in\mathbb R \setminus \{0\}$ and set $f(0)=0$. Let $G$ be the graph of $f$. It is fairly easy to see that $G$ is connected. Can you prove that $\mathbb R ^2\setminus G$ is also connected? This actually follows from a general result in this disseration, which reads:

Theorem 9. If $X$ is a topological space, $f : X \to \mathbb R$, $\text{Gr}(f)$ is connected, and
  $(X \times \mathbb R) \setminus \text{Gr}(f)$ is disconnected then $f$ is continuous.

As $G$ is connected and $f$ is not continuous, we must have that $\mathbb R ^2\setminus G$ is connected.
For your set $A$, take a ray $[0,\infty)$ starting at $(0,0)$ and zig zag in a $\sin(1/x)$ fashion closer and closer to $(1/2,1/2)$. Now do the same thing starting from $(1,1)$. Let $A$ be these two curves, together with the point $(1/2,1/2)$.  Let $B=[0,1]^2\setminus A$. 

$A$ is the part in blue, and $B$ is everything else.
For a slightly simpler example, you could replace the bottom left part of $A$ with the part of the diagonal from $(0,0)$ to $(1/2,1/2)$.
{"set_name": "stack_exchange", "score": 5, "question_id": 1888504}