I am reading from the red book of varieties and schemes of David Mumford about sheaves: Let $R$ be a commutative ring, $1\in R$, $X=\text{Spec}R$ the set of all prime ideals $P \nsubseteq R$ and a $U\subseteq X$ an open subset of $X$ with the Zariski topology. Moreover, let $R_S=S^{-1}R$ the localization of $R$ over a multiplicatively closed subset $S\subseteq R$.
Definition: The author defines $\mathcal{O}_x(U)=\Gamma(U,\mathcal{O}_X)$ to be the set of elements $$\{s_P\} \in \prod_{P\in U} R_P$$ for which there exists a covering of U by distinguished open sets $X_{f_a}$ together with elements $s_a\in R_{f_a}$ such that $s_P$ equals the image of $s_a$ in $R_P$ whenever $P \in X_{f_a}$.
Questions:
1) What exactly are the elements $\{s_p\}$? Is an element $s\in \prod_{P\in U} R_P$ a "P-tuple"? Is it something like $s=(...,s_P,s_Q,...) \in \prod_{P\in U} R_P$ such that $s_P \in R_P$, $s_Q \in R_Q$ for some prime $P,Q \in U$?
2) I suppose that to find the image of $s_a$ in $R_P$, we use the fact that $P \in X_{f_a}$, and so $f_a \notin P$, so we can write $s_a=\frac{g_a}{{f_a}^n} \in R_{f_a}$, hence the image of $s_a$ in $R_p$ is the corresponding germ $[s_a]=[(\frac{g_a}{{f_a}^n},X_{f_a})]$ in the direct limit $$R_P=\varinjlim\limits_{X_f \in U_p} R_f,$$ where $U_p=\{X_f:P\in X_f\}$. Is that right?
3) I can't see how $s_P$ can coincide with $[s_a]$, where $[s_a]$ is the image of $s_a$ in $R_P$. Can you give me a simple example of a commutative ring $R$ and an open $U\nsubseteq X$ such that $\{s_P\}_{P \in U}=\{[s_a]\}_{a\in A}$ as in the above definition? What is $\mathcal{O}_x(U)$ in this case and how is it related with the tuples $\{s_P\} \in \prod_{P\in U} R_P$?
4) Does there exist an alternative definition of $\mathcal{O}_x(U)$ or a book/link which gives more details/examples about this definition?
To answer (4) first, if $X = \mathrm{Spec}(R)$, you can actually define the structure sheaf $\mathcal{O}_X$ to be the unique (up to isomorphism) sheaf satisfying
$$ \mathcal{O}_X(X_f) = R_f $$
and for each inclusion $X_{fg} \subseteq X_f$, the transition map is $R_f \to R_{fg}$. Of course, it takes some work to show that this constructs a well-define sheaf.
As an example, the stacks project takes this approach, although they've defined a lot of machinery prior to this point.
To answer (1), I think to fully understand the idea it helps to consider the following calculation.
If you have a product of identical terms, there is a natural bijection of sets
$$ \prod_{x \in S} T \cong T^S $$
That is, the $S$-indexed product of copies of $T$ can be viewed as the set of functions from $S$ to $T$. In fact, in some set-theoretic foundations, these two sets would be literally equal!
The case of $\prod_{P \in U} R_P$ is a bit more awkward. You can think of its elements as being functions on the domain of primes in $U$, but the codomain is different for each point. Infinite products like this are a standard way of expressing such an idea.
So yes, if $s \in \prod_{P \in U} R_P$, it is indeed a tuple whose index set is the points of $P$, and I imagine the notation Mumford uses will be in line with that. But for intuition, there are times where you may be better served by the interpretation of a tuple as expressing a function on the index set.
To answer (3)
An intuition for this is that the infinite product $\prod_{P \in U} R_P$ can be thought of as the set of "discontinuous" functions on $U$, whereas $\mathcal{O}_X(U)$ is the subset of "smooth" functions on $U$ (or 'regular' or 'algebraic' or whatever informal description you want to use).
As I mentioned before, $\mathcal{O}_X(X_f) \cong R_f$. The idea behind this correspondence is that if $r \in R_f$, then we can think of $r$ as a function whose value at $P \in X_f$ is precisely the class $[r]_P \in R_P$.
(I've added a subscript to emphasize that $[r]_P$ depends on $P$)
For example, if $r \in R$, then we can define the tuple $s$ whose $P$-th component is $s_P = [r]_P$. Then the fact $s \in \mathcal{O}_X(X)$ can be seen because $X$ is covered by the open set $X_1$, and we take the section $s_1 = r$. Then for every point $P$, $s_P = [s_1]_P$.
To answer (2)
Given $P \in X_f$, a simpler description is that the map $R_f \to R_P$ is just the usual localization homomorphism. Every fraction in $R_f$ is already of in the form of a fraction in $R_P$, so it does indeed send $g/f^n \mapsto g/f^n$.
But the filtered colimit you write is indeed a formula for $R_P$: $$ \mathop{\operatorname{colim}}_{X_f \ni P} R_f \cong R_P $$ and the insertion map $R_f \to \mathop{\operatorname{colim}}_{X_f \ni P} R_f$ does indeed send $r \in R_f$ to the germ $[(r, X_f)]$ of that colimit.
Addendum
If $P$ is a prime ideal of $R$, then the set of elements not in $P$ is a multiplicative subset, and the usual definition of $R_P$ is the localization where you invert the elements that are not in $P$.
I'm mentioning this since your exposition suggests Mumford gave a different definition of $R_P$; specifically, the filtered colimit you mentioned earlier.