Let $F$ be an infinite field (that is not necessarily algebraically closed) and consider the algebraic variety $\mathrm{SL}(n,F)=\mathcal{V}(\det-1)$ of $F^{n^2}$, where $$\mathcal{V}(S)=\{\alpha\in F^k\,|\,f(\alpha)=0\ \forall f\in S\}.$$ We say that a Zariski-closed subset $X$ of $F^{n^2}$ is irreducible, i.e., that if there are two non-empty, proper, Zariski-closed subsets $X_1,X_2$ of $F^{n^2}$ such that $X=X_1\cup X_2$, then $X\subseteq X_i$ for some $i=1,2$.
Is there an easy proof that $\mathrm{SL}(n,F)$ is irreducible?
I tried following these notes (see Example 2.25), but I can't quite understand their method. Basically, the proof there says that $\mathrm{SL}(n,F)$ is irreducible if and only if $\det-1$ is an irreducible polynomial in $n^2$ variables.
As mentioned in Theorem 2.27 of the notes, an algebraic variety $X\subseteq F^k$ is irreducible if and only if its ideal $$\mathcal{I}(X)=\{f\in F[x_1,\ldots,x_k]\,|\,f(\alpha)=0\ \forall \alpha\in X\}$$ is prime, so what I really need is a proof that the ideal of $\mathcal{V}(\det-1)$ is prime. Hence, what I'm really asking is this:
Why does irreducibility of $\det-1$ imply that the ideal $\mathcal{I}(\mathcal{V}(\det-1))$ is prime?
EDIT: This also answers the question: Over $\mathbb{R}$, if $Z(p') \subset Z(p)$ when does $p' \vert p$?
You are right that some special properties of SL$_n$ are needed.
First some counterexamples in the general case.
If $F=\mathbb Q$. Consider $x^3+y^3-1\in \mathbb Q[x,y]$. It is an irreducible polynomial, but its zero set is finite and reducible.
Over $\mathbb R$, consider $x^2(x-1)^2+y^2$. It is irreducible, but its zero set is reducible.
In the first case, the field is too small, and in the second case the variety is singular at its real points.
Now in your case, (you are supposed to know that) $f:=\det -1$ is irreducible (over $\mathbb C$), and it defines a smooth variety (it is a Lie group). I claim that under these assumption, the ideal of $V(f)$ is irreducible. In what follows, by algebraic varieties over $\mathbb R$, I mean schemes of finite type over $\mathbb R$, not only real points.
Lemma. Let $X$ be a smooth geometrically irreducible variety over $\mathbb R$ such that $X(\mathbb R)\ne \emptyset$, then $X(\mathbb R)$ is Zariski dense in $X(\mathbb C)$.
Proof: Let $g$ be a regular function on $X$ vanishing at $X(\mathbb R)$. Take any $x_0\in X(\mathbb R)$. By the implicit function theorem, in a small analytic neighborhood of $x_0$, $X(\mathbb C)$ is isomorphic (as complex analytic manifold) to an open disc $D$ in $\mathbb C^d$ with $d=\dim X$. Moreover, this isomorphism is defined using real coefficients, so it induces an isomorphism on the real points. Therefore, $g$ can be viewed as a holomorphic function on $D$ which vanishes at the real points of $D$. This implies that $g=0$ on $D$. But $D$ is Zariski open in $X(\mathbb C)$, so $g=0$.
Now we can prove the claim. Let $g$ be a real polynomial such that $g(V(f))=0$. Let $X$ be the algebraic variety over $\mathbb R$ defined by $f$. Then $g$ is regular on $X$ and vanishes on the real points of $X$. So $g=0$ on $X$. By the usual Nullstellensatz, this implies that $$g\in (f\mathbb C[x_1, \dots, x_n])\cap \mathbb R[x_1, \dots, x_n]=f\mathbb R[x_1, \dots, x_n].$$