I am trying to solve Exercise 2.3.21 from Liu’s book. I have a finite group $G$ acting on an affine scheme $\operatorname{Spec}A$, and I want to show that the quotient scheme $X/G$ exists and is isomorphic to $\operatorname{Spec}A^G$.

I have defined a map from the quotient $X/G$ to $\operatorname{Spec}A^G$, sending the class of a prime ideal $\mathfrak{p}$ to the intersection of $A^G$ and all the primes of the orbit.

However, I am not able to find an inverse. Namely, given a prime in $\operatorname{Spec}A^G$, I would like to map it to the ideal it generates in $A$, but I am afraid that this may not be prime.