TITLE: How do I prove a scheme is connected?
QUESTION [8 upvotes]: Here is the question:
Suppose $X$ is a $k$-scheme, $k=\bar{k}$, if $X$ is connected, then for any algebraically closed field $K$  containing $k$, $X_K=X\times_k\operatorname{Spec}K$ is connected.
I know there is a proof in  the book of the stacks project(here), it firstly proves that if $Y$ is geometrically connected over $k$, then the projection from $X\times_k Y$ to $X$ induces a bijection between the connected components of $X\times_kY$ and the connected components of $X$. Secondly, it is easy to show that if $k$ is algebraically closed and $K$ contains $k$, then $\operatorname{Spec}K$ is geometrically connected. Thus applying the above results we can prove the question. Since the proof of first statement uses the Chevalley's theorem in the non-Noetherian version to show the projection $X\times_kY$ to $X$ is open, I donot like it .

I want to know a direct proof. I want to know if there exists an affine criterion or something like that to show a scheme is connected ? Or are we able to reduce for the Noetherian case ? 


Edit: As Matt E pointed out, we only need to prove that $\Gamma(X_K,\mathcal{O}_{X_K})$ has no nontrivial idempotents. 
Lemma 
Suppose $k$ is algebraically closed, and $K$ contains $k$, $A$ is a $k$ algebra, then the idempotents of $A\otimes_kK$ come from $A$.
Proof  we can assume that $A$ is reduced. Then we have an embedding $A\hookrightarrow \prod A/\mathfrak{p}_i$, tensoring $K$, $A\otimes K\hookrightarrow (\prod A/\mathfrak{p}_i)\otimes K\hookrightarrow \prod A/\mathfrak{p}_i\otimes K$. And since $k$ is algebraically closed, $A/\mathfrak{p}_i\otimes_k K$ is domain, we know the forms of idempotents in the 3th ring. QED.
Now, we will show $\Gamma(X_K,\mathcal{O}_{X_K})$ has no nontrivial idempotents. We pick an affine open cover and intersection of any two affine opens can be covered by an affine cover. Suppose $e$ is an idempotent in the global section, say those affine open we considered are $\operatorname{Spec} A_i\otimes_kK$, then $e$ restricts at every affine open is idempotent and comes from $\operatorname{Spec} A_i$, say $e_i $, thus equals $e_i\otimes_k 1$. All $e_i$ are compatible in $\operatorname{Spec}A_i$, thus we have an unique section $f\in \Gamma(X,\mathcal{O}_X)$ which also is idempotent such that $f$ restricts in $\operatorname{Spec}A_i$ is $e_i$. Hence $f=0$ or $f=1$ ($X$ is connected), all $e_i=1$ or all $e_i=0$, so $e=1$ or $e=0$. We are done.
Remark. In general, $\Gamma(X_K,\mathcal{O}_{X_K})\neq\Gamma(X，\mathcal{O}_X)\otimes_kK$. Let $X=\coprod_{i\in \mathbb{N}}\operatorname{Spec}k$, and $K=k(x)$, then $(\prod k)\otimes_kk(x)\neq\prod k(x)$. 
Thanks

REPLY [3 votes]: This is a comment to Matt E's answer. (I can't seem to comment yet.)
Let $k$ be a field, $K/k$ a field extension and $X$ a $k$-scheme.
How do you prove that $\Gamma(X\times_k K, \mathcal{O}_{X\times_k K}) = \Gamma(X,\mathcal{O}_X)\otimes_k K$ without assuming there exists an affine cover $\{U_i\}$ of $X$ such that $U_i\cap U_j$ is affine for all $i,j$? This condition is verified for separated schemes, and also for "semi-separated" schemes (by definition).
If you have such a cover you have  the Cech complex associated to it. Tensoring this  gives the equality by flatness of $K$ over $k$. 
So how do you prove the above equality when $X$ is not semi-separated?