$\DeclareMathOperator{\colim}{colim} \DeclareMathOperator{\Spec}{Spec}$

[Edit1] I should point out that the colimits below are in the category of schemes, since the statements are trivially false for colimits in the category of affine schemes. [/Edit1]

In this answer Martin points out that $\coprod_i \Spec R_i \ne \Spec \prod_i R_i$ in general. This also proves for $$ \colim_{i \in I} \Spec R_i \ne \Spec \lim_{i \in I} R_i. $$ (Though taking a non-affine scheme, and writing it as colimit of affines might even be a more 'natural' proof.) Now I wondered if what happens if we take global sections on both sides, i.e., $$ \mathcal{O}(\colim_{i \in I} \Spec R_i) \stackrel{?}{=} \lim_{i \in I} R_i. $$ For several (co)limits, I verified this is true. And actually there is a natural map from right to left.

But is this map

$$ \lim_{i \in I} R_i \to \mathcal{O}(\colim_{i \in I} \Spec R_i) $$

an isomorphism:

- when $I$ is finite?
- if so, when $I$ is small?