Let $k$ be a field and $A:=k[x_1,x_2,\cdots,x_n]$ be the polynomial ring with $n$ variables. Now let's consider a closed subset $Y \subset Spec(A)$. Here $Spec(A)$ is the spectrum of polynomial ring $A$. We want to show that the maximal ideals in subset $Y$ are dense in $Y$.
Now I can only solve the case when $Y=Spec(A)$. In this case, if all the maximal ideals are not dense in $Spec(A)$, there must exist a non trivial ideal $I \subset A$ such that $I$ belongs to the intersection of all the maximal ideals. But in the polynomial ring $A$, the intersection of all the maximal ideals is zero. So we get a contradiction. But I do not have many ideas on the general case.
This true since if $Y$ is defined by $I$, $A/I$ is a Jacobson ring since it is a finitely generated $k$-module (see example 3 in the reference). That is every prime is the intersection of maximal ideals, this implies that the nilradical of $A/I$ is the intersection of its maximal ideal, so the set of maximal ideal is dense.
https://en.wikipedia.org/wiki/Jacobson_ring