I am trying to solve the following problem.
I have shown that the following collection of subsets of $\mathbb{Z}$ is a base for a topology $\tau$ on $\mathbb{Z}$:
$\mathbb{B} =$ { {$2k + 1$} : $k \in \mathbb{Z}$} $\cup$ { {$2k-1, 2k, 2k+1$} : $k \in \mathbb{Z}$}.
Now, where $\mathbb{R}$ has the usual topology and $\mathbb{Z}$ has this topology $\tau$, I want to find a continuous open or closed surjection $p : \mathbb{R} \to \mathbb{Z}$. But I have been unable to find one so far; the floor and ceiling functions are surjective but not continuous.
Any ideas or hints would be appreciated!
Let
$$p(x) = \begin{cases} 2k &, x = 2k \\ 2k+1 &, 2k < x < 2k+2, \end{cases}$$
where $k\in \mathbb{Z}$. Then $p$ is continuous. At $x = 2k,\, k\in \mathbb{Z}$, the smallest open set containing $p(x)$ is $U = \{2k-1,2k,2k+1\}$, and $p^{-1}(U) = (2k-2,2k+2)$ is a neighbourhood of $x$. At $x \in \mathbb{R}\setminus 2\mathbb{Z}$, $p$ is constant on a neighbourhood of $x$, so $p$ is continuous at $x$.
$p$ is also open. If $U\subset \mathbb{R}$ is open and contains $2k$, then $p(U) \supset \{2k-1,2k,2k+1\}$, so is a neighbourhood of $p(2k)$. For $x \in U\setminus 2\mathbb{Z}$, $\{p(x)\}$ is already open.