I'm reading Algebraic and Arithmetic Curves written by Qing Liu. I have a question about the properties of a scheme. Let $X$ be a scheme and $x\in X$ an arbitrary point, we can find an open subset of $X$, $U$, so that ($U$, $\mathscr{O}_X|_U$) is an affine scheme. In a proposition it was said that $Spec \mathscr{O}_X(U)\cong U$. I couldn't show why this is correct
My attempt: $U$= Spec $A$, where $U$ is covered with $\{U_i\}_{i\in I}$ and $I$ is finite. Let $U_i=D(f_i)$, $\forall i\in I: f_i\in A$. Therefore we have $\mathscr{O}_X|_U(U_i)=A_{f_i}$. Sections of $\mathscr{O}_X(U)$ are isomorphic with $S=\{(s_i)_{i\in I}\}$ where in each tuple, $s_i$ is a section that belongs to $\mathscr{O}_X|_U(U_i)$ and $s_i$ and $s_j$ agree on their intersection. I tried to define an isomorphism from Spec $S$ to $U$
I would be thankful for any help
One additional question, if $s_i$ and $s_j$ belong to $A_{f_i}$ and $A_{f_j}$ respectively where they agree on the intersection, does this mean we can represent them as $\dfrac{a_i}{f_i^m}$ and $\dfrac{a_j}{f_j^n}$ so that $\exists t\in\mathbb{N}: (f_if_j)^t(a_if_j^n-a_jf_i^m)=0$ ?