Lemma 48.25.9. Let $f : X \to Y$ be a morphism of schemes which is flat and locally of finite type. Then formation of the set $\{ x \in X \mid f\text{ is Gorenstein at }x\}$ commutes with arbitrary base change.

Proof. The assumption implies any fibre of $f$ is locally of finite type over a field and hence locally Noetherian and the same is true for any base change. Thus the statement makes sense. Looking at fibres we reduce to the following problem: let $X$ be a scheme locally of finite type over a field $k$, let $K/k$ be a field extension, and let $x_ K \in X_ K$ be a point with image $x \in X$. Problem: show that $\mathcal{O}_{X_ K, x_ K}$ is Gorenstein if and only if $\mathcal{O}_{X, x}$ is Gorenstein.

The problem can be solved using a bit of algebra as follows. Choose an affine open $\mathop{\mathrm{Spec}}(A) \subset X$ containing $x$. Say $x$ corresponds to $\mathfrak p \subset A$. With $A_ K = A \otimes _ k K$ we see that $\mathop{\mathrm{Spec}}(A_ K) \subset X_ K$ contains $x_ K$. Say $x_ K$ corresponds to $\mathfrak p_ K \subset A_ K$. Let $\omega _ A^\bullet$ be a dualizing complex for $A$. By Dualizing Complexes, Lemma 47.25.3 $\omega _ A^\bullet \otimes _ A A_ K$ is a dualizing complex for $A_ K$. Now we are done because $A_\mathfrak p \to (A_ K)_{\mathfrak p_ K}$ is a flat local homomorphism of Noetherian rings and hence $(\omega _ A^\bullet )_\mathfrak p$ is an invertible object of $D(A_\mathfrak p)$ if and only if $(\omega _ A^\bullet )_\mathfrak p \otimes _{A_\mathfrak p} (A_ K)_{\mathfrak p_ K}$ is an invertible object of $D((A_ K)_{\mathfrak p_ K})$. Some details omitted; hint: look at cohomology modules. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).