The quotient scheme $X/\Gamma$ when $X$ is separated and every orbit is contained in an affine. I am trying to solve Problem II.4.7(a) of Hartshorne:



The only candidate I can think of for $X_0$ would be the quotient scheme $X/\sigma$. If it exists, it must be unique by the usual argument. First starting with the affine case, taking $A=\mathbb C[x_1,...,x_n]/I$ to be a finitely generated $\mathbb C$-algebra, then the associated ring morphism that commutes with conjugation would leave us with the invariant algebra being $A^\sigma=\mathbb R[x_1,...,x_n]/\bar I $ where $\bar I$ is the real part of $I$. Then here it follows that $\text{Spec}A^\sigma\times_\mathbb{R}\mathbb C=\text{Spec}A$ by just tensoring $A^\sigma\otimes_\mathbb{R}\mathbb C=A$.
For the general case, I found a helpful clue from Bosch's AG book.  Exercise 7.1.8 of Bosch says:

Let $X$ be a scheme and $\Gamma$ a finite group of automorphisms. The quotient $X/\Gamma$ exists if there is a $\Gamma$-invariant affine open cover of $X$. Further,  if $X$ is separated, then the quotient $X/\Gamma$ exists if all the points in any $\Gamma$-orbit are contained in an open affine.

Since by assumption we have that any two points are in an open affine and our orbit has at most two points, this exercise will give us the existence of the quotient. But I want to prove it first.

My idea is to first construct the scheme to be locally the invariant rings. That is, if $X=\bigcup_{i=1}^n\text{Spec}A_i$, take $X/ \Gamma := \bigcup_{i=1}^n \text{Spec}A_i^{\Gamma}$ as a set. Since $X$ is separated, the intersection of any two affines is affine, and define $\text{Spec}A_{ij}:=\text{Spec}(A_i^\Gamma\otimes_\mathbb{C} A_j^\Gamma)=\text{Spec}A_i^{\Gamma}\cap \text{Spec}A_j^{\Gamma}$, which I naively want to use to glue together.
However, the cocycle condition is not necessarily satisfied since we don't seem to have an isomorphism here: $\text{Spec}A_{ij}\cap \text{Spec}A_{ik}=\text{Spec}(A_{ij}\otimes_\mathbb{C} A_{ik})$, but $\text{Spec}A_{ji}\cap \text{Spec}A_{jk}=\text{Spec}(A_{ij}\otimes_\mathbb{C} A_{jk})$, and $A_{ij}\neq A_{jk}$, and from here I'm lost.

A second idea is the following: let $U$ be an affine open, and since $\gamma\in\Gamma$ is an automorphism, then $\gamma(U)$ is affine. Then, since intersections of finitely many affines is affine in a separated scheme, we have that $\bigcap_{\gamma\in\Gamma}\gamma(U)$ is nonempty, affine, and $\Gamma$-invariant. Since every orbit lies in some affine, then we have that open sets of this form actually form an open cover of $X$. So this proves that the second part of the exercise, once we show the first part.
 A: Let's tackle the affine case first. If $X=\operatorname{Spec} A$ is an affine $\Bbb C$-scheme, then we can check directly that $X^0=\operatorname{Spec} A^\sigma$ works, by demonstrating that $A^\sigma\otimes_\Bbb R \Bbb C\cong A$. To do this, define a map $A\to A^\sigma\otimes_\Bbb R \Bbb C$ by $a\mapsto \frac{a+\sigma(a)}{2}\otimes 1 - \frac{ia-\sigma(ia)}{2}\otimes i$ and a map $A^\sigma\otimes_\Bbb R \Bbb C\to A$ by $s\otimes (x+iy) = xs+iys$. It is immediate to see that these are mutually inverse, so $A^\sigma\otimes_\Bbb R\Bbb C \cong A$, and this is clearly unique.
For the general case, start by picking a finite $\sigma$-invariant affine open cover $\{U_i=\operatorname{Spec} A_i\}$ as you've done in your edit. Now the intersections $U_{ij}=\operatorname{Spec} A_{ij}$ of these affine opens are affine by separatedness and $\sigma$-invariant by construction, and the immersions $\operatorname{Spec} A_{ij}\to \operatorname{Spec} A_i$ from these intersections are intertwiners for the $\sigma$ action. We therefore have that the gluing data comes from $\Bbb R$-morphisms $A_i^\sigma\to A_{ij}^\sigma$, and by exercise II.2.12, we can use this gluing data to construct $X_0$. $X_0$ is finite type over $\Bbb R$ because it's covered by finitely many spectra of finitely-generated $\Bbb R$-algebras, uniqueness follows from the uniqueness for affines and the uniqueness of gluing, so all that's left to do is to check separatedness.
As $X\to \Bbb C$ is separated, $\Delta:X\to X\times_{\Bbb C} X$ is a closed immersion, and it's also the base change of $\Delta_0:X_0\to X_0\times_\Bbb C X_0$. Any diagonal map is a locally closed immersion, so it suffices to check that the image is closed. As $X\times_\Bbb C X\to X_0\times_{\Bbb R} X_0$ is finite, it is closed, and we are done.

The "full generality" version of this is generally called descent. In this case, we're explaining Galois descent for a particular finite extension of fields, but you can push this a lot further. One introduction to the topic I like is Poonen's Rational Points, available here on his website, which covers this in chapter 4.
