Glue DVR to itself, get a separated non-affine scheme

Here is what seems to be a fun little exercise in algebraic geometry. Take a DVR $$R$$ and automorphism of $$Frac(R)$$; glue $$Spec(R)$$ to itself via this automorphism. Can the glued scheme be separated non-affine?

For separatedness, the automorphism must fail to preserve $$R$$ (https://mathoverflow.net/a/335962). For some DVRs, no such automorphism exists, e.g. $$k[[x]]$$ (https://mathoverflow.net/a/336022) and $$\mathbb{Z}_p$$ (https://math.stackexchange.com/a/449465).

• I'm voting to close this question as off-topic because the OP is trolling. – Steven Landsburg Jul 15 '19 at 4:52
• @StevenLandsburg The Wikipedia page on Internet trolls says that they post "inflammatory and digressive, extraneous, or off-topic messages." Does this question satisfy any of these descriptions? IMHO this is a reasonable on-topic question. – user143116 Jul 15 '19 at 11:37

We have a DVR $$R$$ and an automorphism $$\phi:Frac(R)\rightarrow Frac(R)$$ such that $$\phi(R)$$ is not a subset of $$R\subset Frac(R)$$. We glue $$\mathrm{Spec}\:R$$ to itself along the generic point by $$\phi$$. Denote the resulting separated scheme by $$X$$.
First, let us compute $$\Gamma(X, \mathcal{O}_X)$$. If we take an open cover, giving a global section of $$\mathcal{O}_X$$ is the same as giving a section of $$\mathcal{O}_X$$ on each member of the cover so that the sections agree on the overlaps. So $$\Gamma(X, \mathcal{O}_X)$$ is identified with the ring $$R\cap \phi(R)\subset Frac(R)$$.
Note that $$R$$ is not a subset of $$\phi(R)$$ because if it were then $$\phi^{-1}$$ would preserve the order induced by the valuation; then $$\phi$$ would preserve the order but that is impossible because $$\phi(R)$$ is not a subset of $$R$$ by assumption. Thus Theorem 12.2 in "Commutative ring theory" (Matsumura) gives us that $$R\cap \phi(R)$$ is a PID that has exactly two distinct maximal ideals: $$\mathfrak{m}\cap \phi(R)$$ and $$R\cap \phi(\mathfrak{m})$$.
Consider the canonical map $$X\rightarrow \mathrm{Spec}\:\Gamma(X, \mathcal{O}_X)$$. A point $$x\in X$$ is mapped to (the point corresponding to) the kernel of the canonical homomorphism $$\Gamma(X, \mathcal{O}_X)\rightarrow k(x)$$. So the generic point is mapped to $$\{0\}$$, and two closed points are mapped $$\mathfrak{m}\cap \phi(R)$$ and $$R\cap \phi(\mathfrak{m})$$ respectively. As remarked above, the ideals are distinct so the map $$X\rightarrow \mathrm{Spec}\:\Gamma(X, \mathcal{O}_X)$$ is injective. Because $$X$$ and $$\mathrm{Spec}\:\Gamma(X, \mathcal{O}_X)$$ both have 3 points, it is bijective and one directly verifies that it is a homeomorphism so $$X$$ is affine by Stacks 04DE. Admittedly, one could show that the map $$X\rightarrow \mathrm{Spec}\:\Gamma(X, \mathcal{O}_X)$$ is affine more directly by looking at the inverse images of the affine opens but I like this mode of argumentation more.