Given two topological spaces $X$ and $Y$, let $Z=X\times Y$ with the topology of separate continuity (i.e, the finest topology such that the inclusion of every horizontal and vertical section is continuous).
Theorem: Suppose $X$ and $Y$ are countable regular spaces. Then $Z$ is normal.
Proof: Let $A,B\subset Z$ be disjoint closed sets. The idea is to construct open sets $U$ and $V$ separating them by a dovetailing inductive process where at each step, we add a new horizontal or vertical neighborhood to either $U$ or $V$. We start with $U_0=A$ and $V_0=B$, and inductively construct larger and larger sets $U_n$ and $V_n$ such that $\overline{U_n}\cap \overline{V_n}=\emptyset$ for each $n$. To define $U_{n+1}$, choose a point $(x,y)\in U_n$ and either an open neighborhood $W\subseteq X$ of $x$ or an open neighborhood $W\subseteq Y$ of $y$ such that $\overline{W}\times\{y\}$ (or $\{x\}\times\overline{W}$) is disjoint from $\overline{V_n}$ (we can do this because $U_n\cap\overline{V_n}=\emptyset$ and $X$ and $Y$ are regular). Define $U_{n+1}=U_n\cup W\times\{y\}$ (or $U_{n+1}=U_n\cup\{x\}\times W$). To define $V_{n+1}$, do the same thing (add a horizontal or vertical neighborhood to $V_n$ while keeping the closure disjoint from $\overline{U_{n+1}}$).
Using the countability of $X$ and $Y$, it is easy to see that we can arrange to choose the points we add horizontal/vertical neighborhoods around in a dovetailing fashion such that every point in any $U_n$ or $V_n$ eventually gets a horizontal and vertical neighborhood around it added to some later $U_m$ or $V_m$. Thus the sets $U=\bigcup_n U_n$ and $V=\bigcup_n V_n$ have the property that for any $p\in U$, there is both a horizontal and a vertical neighborhood of $p$ contained in $U$, and similarly for $V$. This says exactly that $U$ and $V$ are open in $Z$. By construction, $U$ and $V$ are disjoint and contain $A$ and $B$. Thus $Z$ is normal.
Now to answer your question, let $X=Y=\mathbb{Q}$. It is easy to construct a proper subset $E\subset \mathbb{Q}\times\mathbb{Q}$ which is dense in the product topology but closed in the $Z$-topology (for instance, inductively choose points of $E$ such that $E$ contains at most one point on each horizontal and vertical line). If $p\not\in E$, then by the Theorem and Urysohn's lemma, there is a continuous function $f:Z\to\mathbb{R}$ sending $E$ to $0$ and $p$ to $1$. Since continuity on $Z$ is exactly separate continuity, this satisfies your requirements.