Is the product of non-separated schemes non-separated?

My question is the title, but let me be more specific: for schemes $X$ and $Y$ over $S$, with at least one non-separated over $S$, is it true that the fibered product $X\times_S Y$ is also not separated over $S$?

My instinct says "no" because of the remarks at the top of page 95 in Hartshorne: "The rough idea is that in order for a schemes $X$ to be separated, it should not contain any subscheme which looks like a curve with a doubled point..." So if $X$ is not separated, it contains such a subscheme, and thus so should the product $X\times_S Y$.

I tried proving the claim using the valuative criterion, and I think I was able to do it. Unfortunately, I don't know how to typeset diagrams here (it seems xymatrix is not supported), but the idea is to take 2 of the different morphisms from $T$ to $X$ (using the notation of Hartshorne here in which $T = \text{Spec}(R)$ for a valuation ring $R$) and make them morphisms to the product. Unless I overlooked something, the proof was pretty simple.

Is all this correct or are there counter-examples out there?

EDIT: As pointed out by Martin Brandenburg below, in general, the product of non-separated schemes could be separated. However, I think it is true that if the schemes are all over some field $k$ then non-separated-ness is preserved under taking products. Is this true, and if so, how would one prove it?


Edit: Clean up and some simplifications.

So suppose we work over a ground field $k$. Then the answer is yes.

Suppose $X\times_k Y$ is separated and non-empty, then $X, Y$ are both separated if they are noetherian.

As $Y$ is noetherian and non-empty, it contains a closed point $y\in Y$. Let $K=k(y)$. Then $X_K:=X\times_k \mathrm{Spec}(K)$ is separated because it is a closed subscheme of a separated scheme.

Let $\{ U_i\}_i$ be an affine covering of $X$. Then $\{ (U_i)_K \}_i$ is an affine covering of $X_K$. By the separatedness, $(U_i\cap U_j)_K=(U_i)_K\cap (U_j)_K$ is affine and the canonical map $$ O_{X_K}((U_i)_K)\otimes_K O_{X_K}((U_j)_K) \to O_{X_K}((U_i)_K\cap (U_j)_K)$$ is surjective. As $k\to K$ is faithfully flat, it is known that $U_i\cap U_j$ is then affine (as $X$ is noetherian, $U_i\cap U_j$ is quasi-compact, this is needed in the proof of affiness, see e.g. here), and $$O_X(U_i)\otimes_k O_X(U_j)\to O_X(U_i\cap U_j)$$ is surjective. This is equivalent to $X$ separated. By symmetry, $Y$ is separated.


More generally:

Let $X,Y$ be schemes over a field $k$. If $X \times_k Y$ is separated and non-empty, then $X$ and $Y$ are separated.

Proof: Since $X \times_k Y$ is separated over $k$, it is also separated over $Y$ (EGA I, 5.3.1. (v)). Let $y \in Y$. It follows that $X \times_k k(y) \cong (X \times_k Y) \times_Y k(y)$ is separated over $k(y)$. But then $X$ is separated over $k$ (SGA 1, Exp. 5, Cor. 4.8). $\square$

Remark. The same statement holds for many other properties $P$ of schemes. It only has to satisfy descent (DESC), be stable under base change (BC), and satisfy the property $g \circ f \in P \Rightarrow f \in P$ (CANC). In the Appendix of Görtz-Wedhorn, Algebraic Geometry, Part I you find many such properties, for example: locally of finite type, separated. Sometimes (CANC) only holds when $g$ has additional properties. Using the already dealt cases, we also get the statement about products for: affine, locally of finite presentation, proper, qs, qcqs.