Construct a subset of a rectangle Given the rectangle $Q$, find a subset $S$ of $Q$ whose closure equals $Q$, such that $S$ contains at most one point on each vertical line and at most one point on each horizontal line.
I really don't figure out why there must exists such a set; can you give me an example? 
 A: This answer is for the more stringent interpretation of the problem noted by Neal in the comments.
Let $\pi_x:\Bbb R^2\to\Bbb R:\langle x,y\rangle\mapsto x$ and $\pi_y:\Bbb R^2\to\Bbb R:\langle x,y\rangle\mapsto y$ be the usual projection maps from $\Bbb R^2$. Let $\mathscr{B}=\{B_n:n\in\Bbb N\}$ be a countable base for the topology of $Q$ as a subspace of $\Bbb R^2$. 
Construct $S$ recursively as follows. Let $S_0=\varnothing$. Given a finite set $S_n\subseteq Q$ for some $n\in\Bbb N$, let $X_n=\pi_x[S_n]$ and $Y_n=\pi_y[S_n]$. $X_n$ is finite, so there is an $x_n\in\pi_x[B_n]\setminus X_n$. Moreover, $B_n\cap(\{x_n\}\times\Bbb R)$ is infinite (why?), so there is a $y_n\in\pi_y[B_n]\setminus Y_n$ such that $\langle x_n,y_n\rangle\in B_n$; let $S_{n+1}=S_n\cup\{\langle x_n,y_n\rangle\}$.
Now let $S=\bigcup_{n\in\Bbb N}S_n$, and show that


*

*$S$ is dense in $Q$, and  

*for each $x\in\Bbb R$, each of the sets $\{x\}\times R$ and $\Bbb R\times\{x\}$ contains at most one point of $S$.

A: There are an infinity of possible sets S. Let A = {interior points of Q} and B = {a, b, c, d} where the points a ,b, c, d are each other in one
 side of Q. Then S= A∪B trivially satisfy. Consider the sets X = {(x, y)∈ Q : x and y are rational} and Y = (Q \ P)∪B where P is the perimeter of Q and B as above. Then X∩Y is another example of S.
