Are sections of the structure sheaf of a scheme determined by their values at its closed points? This question got me thinking if it's true that for every commutative ring with $1$, $R$, we have that the structure sheaf of $X_{max}=MaxSpec R$ at a distinguished open set $D(f)$ is exactly $R_f$. As I don't know the answer for this, but do know it's true for $X=Spec R$ I tried the following approach:
Define the sections of the structure sheaves at an open set $U$ as functions $s:U\to\bigsqcup_{I\in U} A_I$, where $I$ is either a maximal or prime ideal depending on whether we're working in $MaxSpec$ or $Spec$, respectively, and we further require that these sections are locally a quotient.
I tried coming up with an isomorphism between $\mathcal{O}_{X_{max}}(D(f))\cong\mathcal{O}_X(D(f))$ or a counterexample. The isomorphism seems clearly true when $R$ is an integral domain, but is it still true in general? Clearly, given any open set $U$, every $s\in\mathcal{O}_X(U)$ induces a section in $\mathcal{O}_{X_{max}}(U)$, but how about the converse? Is every section of the structure sheaf of a scheme determined by its values in the closed points?
Here's my attempt to construct a counter example:
Consider $R$ not an integral domain with a unique maximal ideal $m$ containing at least another prime ideal $(0)\subsetneq p\subsetneq m$. Furthermore, assume there are two different elements $r,s\in R$ and some $0\neq f\in m-p$ such that $rf=sf=0$. Then, we further assume $\frac{r}{1}\neq\frac{s}{1}\in R_m-\{0\}$, and by construction they are both zero in $R_p$.
Therefore, $r$ and $s$ define different global sections of $\mathcal{O}_X$, but are both zero as sections of $\mathcal{O}_{X_{max}}$. In this way we conclude that both sheaves are different, so they must also differ in the basic open sets of the topology.
Is my reasoning correct?
 A: Let $R$ be local domain (but not a field) and $0\neq f$ a non-unit.
If we work with the maximal spectrum, we have $D(f)=\emptyset$, i.e. there are no sections.
If we work over the prime spectrum, we have the familiar $\mathcal O_{\operatorname{Spec} R}(D(f))=R_f \neq 0$.

To understand whats going on here, you should take another look at the proof that $\mathcal O_{\operatorname{Spec} R}(D(f))=R_f$, for instance at Hartshorne. You will notice that the fact $\sqrt I = \bigcap\limits_{\mathfrak p \supset I} \mathfrak p$ is a crucial ingredient of the proof.
It turns out that you can actually take the same proof for the maximal spectrum if $\sqrt I = \bigcap\limits_{\mathfrak m \supset I} \mathfrak m$ (only running through maximal ideals) holds, i.e. if $R$ is a Jacobson ring (for example if $R$ is a finitely generated algebra over a field).
A local ring of positive dimension is of course not a Jacobson ring, thats how I came up with the counterexample.
Summarizing, the question whether $\mathcal O_{\operatorname{MaxSpec} R}(D(f))=R_f$ holds comes down to the question whether $R$ is a Jacobson ring. Being a domain or not is totally irrelevant. This should also answer your other question. There $R$ was a finitely generated $k$-algebra, i.e. everything is fine there.
