TITLE: Is a set open in a product of spaces if all its segments are open in their factors?
QUESTION [5 upvotes]: Let $X$ and $Y$ be topological spaces and let be $U ⊂ X × Y$ such that
$$∀(x,y) ∈ X × Y \colon \quad \begin{aligned}•~~\mathrm{incl.}_{(–,y)}^{-1}(U) ~\text{is open in $X$,}\\•~~\mathrm{incl.}_{(x,–)}^{-1}(U)~\text{is open in $Y$,}\end{aligned}$$
where $\mathrm{incl.}_{(–,y)}$ denotes the inclusion $X → X × Y, x ↦ (x,y)$ at $y$ and $\mathrm{incl.}_{(x,–)}$ similarly.
Is $U$ then open in $X × Y$?
Ad context: I was trying to show that a bilinear map $X × Y → Z$ of topological vector spaces is continuous by showing that the corresponding linear maps, obtained by fixing one of the arguments, are all continuous. I tried to prove the above mentioned false conjecture, but I had no ideas to start with.

REPLY [4 votes]: Consider the set $(\mathbb R\times\mathbb R)\setminus\{(x,x):x\ne0\}\subset\mathbb R\times\mathbb R$.