Does this intuition for "calculus-ish" continuity generalize to topological continuity?

It’s essentially the same intuition: you want to define the topology on $X\times Y$ in such a way that as you move around continuously in $X\times Y$, your ‘shadows’ on the $X$ and $Y$ ‘walls’ move continuously as well. More specifically, you want to know that as you approach a point $\langle x,y\rangle\in X\times Y$, your $X$ and $Y$ projections approach $x$ and $y$ respectively. Of course you may have some trouble getting across the idea that approach depends on the topology chosen; the connection is really intuitive only for metric and linearly ordered spaces. Perhaps it’s better to avoid the idea of approaching a point dynamically and look at limit points. You want to choose the topology of $X\times Y$ so that if $\langle x,y\rangle$ is so close to $A$ that it can’t be separated from $A$ by an open set $-$ i.e., if it’s in $\operatorname{cl}_{X\times Y}A$ $-$ then $x$ and $y$ are so close to the ‘shadows’ $\pi_X[A]$ and $\pi_Y[A]$, respectively, that they can’t be separated from them.


As countinghaus pointed out in the comments, your intuition for continuity is correct as long as the topological space is second countable and Hausdorff. The intuition to which I am referring is the condition $\lim_{x\to c} f(x)=f(c)$ for all $c\in X$.

However, for general topological spaces, we encounter problems with this intuition. If we remove the condition that the space be Hausdorff, then the problem is that the question: "using your common sense, what should the value here be?" may have multiple (even infinitely many) correct answers (where correct means "makes the function continuous"). For example, if we equip a set $Y$ with the trivial topology, then every function $f:X\to Y$ is continuous (here $X$ denotes an arbitrary topological space). Suppose we look at a function $f:X\to Y$ where $f(x)=c$ for all $x\not=x'$ with $c\in Y$, $x'\in X$. Then we can ask the question "using your common sense, what should the value at zero be?", we might expect $f(x')=c$ to be the correct answer (it makes $f$ a constant function), but this is not a unique answer because any value for $x'$ makes $f$ continuous!

The necessity of the second countability condition is more subtle. Let $X$ denote the long line. If you are unfamiliar with this space, I recommend reading about it because it is great for finding counterexamples like this one! The idea behind the long line is to "paste" together uncountably many copies of the half-open interval $[0,1)$. Note that the real line $\mathbb{R}$ is homeomorphic to a countable such pasting. The term "long line" comes from the idea that we are simply pasting more of these same intervals, so the resulting space should be "longer" than the standard real line.

Now, consider the function $f:X\to\mathbb{R}$ where $f$ is $\sin(2\pi x)$ on each $[0,1)$ interval. I agree that I did not rigorously define this function but that is because I chose not to rigorously define the long line. Suffice it to say that it is not hard to rigorously define the function $f$, but the intuition is clear. Now, We might expect that $f$ is continuous (for if we did this with a countable pasting, we would obtain the function $\sin(2\pi x)$ on $\mathbb{R}$, which is continuous). However, it can be shown that every continuous function whose domain is the long line is eventually constant. That is, for intervals far enough down the line, the function maintains a constant value. Since our function $f$ is not eventually constant, it cannot be continuous.

This is why we need our topological space to be second countable and Hausdorff in order for your intuition to be the correct one. As for your question on the product topology specifically, I believe Brian Scott has handled this superbly in his answer.