Proving a set is open in a locally ringed space $(X,\mathscr O_X)$ Let $(X, \mathscr O_X)$ be a locally ringed space and let $A = \Gamma(X,\mathscr O_X)$ be the global sections. For $f\in A$, define the "distinguished open base" as:
$$D(f) = \{x\in X : \pi_x(f) \not\in \mathfrak m_x\}$$
where $\pi_x: A \to \mathscr O_{X,x}$ and $\mathfrak m_x$ is the maximal ideal of $\mathscr O_{X,x}$.
I can show that this is an open set using the explicit construction of the stalk at $x$ in terms of elements of the form $\prod_{x\in X}(f_x,U_x)$ for $U_x$ containing $x$ and $f_x \in \mathscr O_X(U_x)$ with some consistency conditions on the $f_x$. This is essentially the proof given here.
I would like a proof that avoids the use of explicit elements in $\mathscr O_{X,x}$ and only uses the fact that the stalk is the co-limit of $\mathscr O_X(U)$ for all open sets $U$ containing $x$ with the restriction maps included.
 A: I don't really think the proof you're asking for exists.  The reason is that if you have an element $f$ of a local ring $(O,m)$ and want to express the statement $f\not\in m$ in some reasonably categorical way, it will involve maps into $O$, not maps out of $O$.  Specifically, an element of $O$ is the same thing as a ring-homomorphism $\mathbb{Z}[x]\to O$ (via where you send $x$), and the corresponding element is not in $m$ iff your ring-homomorphism factors through the inclusion $i:\mathbb{Z}[x]\to\mathbb{Z}[x,x^{-1}]$.
Now let's look at the case where $(O,m)=(\mathscr{O}_{X,x},\mathfrak{m}_x)$.  Since the condition involves maps into $O$ rather than maps out of $O$, the fact that your $O$ is a colimit is not helpful (it would be helpful if it were a limit).
The closest thing to an "abstract nonsense" proof I can see is the following.  In the category of commutative rings, the rings $\mathbb{Z}[x]$ and $\mathbb{Z}[x,x^{-1}]$ have a special property: they are compact, meaning that the functor $\operatorname{Hom}(K,-)$ preserves filtered colimits (for $K=\mathbb{Z}[x]$ or $K=\mathbb{Z}[x,x^{-1}]$).  Concretely, this means that if you have a filtered colimit $B=\operatorname{colim}_{I} B_i$ and a map $f:K\to B$, then $f$ factors through the inclusion $B_i\to B$ for some $i$, and furthermore that if you have two lifts $g,g':K\to B_i$ of $f$, then there is a map $i\to j$ in the index category $I$ such that $g$ and $g'$ become equal when composed with the corresponding map $B_i\to B_j$.
In particular, suppose you have an element $f\in A$ and a point $x\in D(f)$.  This corresponds to a map $f:\mathbb{Z}[x]\to A$, such that there exists a map $g:\mathbb{Z}[x,x^{-1}]\to\mathscr{O}_{X,x}$ such that $gi=\pi_x f$ (here $i$ is the map $\mathbb{Z}[x]\to\mathbb{Z}[x,x^{-1}]$ mentioned above).  By compactness of $\mathbb{Z}[x,x^{-1}]$ and the definition of $\mathscr{O}_{X,x}$ as a filtered colimit, there is some open set $U$ containing $x$ and a lift $g_U:\mathbb{Z}[x,x^{-1}]\to \mathscr{O}_X(U)$ of $g$.  Let $h_U=g_Ui$, and let $f_U$ be the composition of $f$ and the restriction map $A\to\mathscr{O}_X(U)$.  We then see that $f_U$ and $h_U$ become equal after composing them with the inclusion map $\mathscr{O}_X(U)\to \mathscr{O}_{X,x}$.  Since $\mathbb{Z}[x]$ is compact, this implies there is an open set $V\subseteq U$ containing $x$ such that $f_U$ and $h_U$ become equal after composing with the restriction $\mathscr{O}_X(U)\to\mathscr{O}_X(V)$.  Denoting this common composition by $f_V$ and the composition of $g_U$ with the restriction by $g_V$, we see that $f_V=g_Vi$.  For any $y\in V$, we can let $f_y$ and $g_y$ be the compositions of $f_V$ and $g_V$ with the inclusion $\mathscr{O}_X(V)\to \mathscr{O}_{X,y}$, and we have $f_y=g_yi$.  But $f_y=\pi_y f$, so the existence of such a $g_y$ says exactly that $y\in D(f)$.  Thus $V$ is an open neighborhood of $x$ contained in $D(f)$.
(To be sure, this proof doesn't really avoid talking about elements of $\mathscr{O}_{X,x}$; it just hides it in the proof that $\mathbb{Z}[x]$ and $\mathbb{Z}[x,x^{-1}]$ are compact, which I have not given.  Indeed, via the correspondence between maps out of $\mathbb{Z}[x]$ and elements of rings, the statement that $\mathbb{Z}[x]$ is compact corresponds exactly to the explicit description of elements of a filtered colimit that you are trying to avoid.)
