I'm reading Algebraic Geometry I by Görtz and Wedhorn. Definition 1.46 is about prevarieties:
A prevariety is a connected space with functions $(X,\mathcal{O}_X)$ with the property that there exists a finite covering $X=\bigcup_i^n U_i$ such that the space with functions $(U_i,\mathcal{O}_{X\mid U_i})$ is an affine variety for all $i=1,\dots ,n$.
Let $U\subseteq X$ be open and $f\in\mathcal{O}_X(U)$. How do we show that $f$ is continues? We only know that $f$ is continuous if we have $U\subseteq U_i$ for some $i$.
If $f \in \mathcal{O}_X(U)$, then for any member $U_i$ of the affine open cover, the restriction $f|_{U \cap U_i} \in \mathcal{O}_X(U\cap U_i)$ is continuous when viewed as a map $f|_{U \cap U_i} : U\cap U_i \to \mathbb{A}^1_k$, where $\mathbb{A}^1_k$ denotes the affine line over the ground field $k$. Let $V$ be an open subset of $\mathbb{A}^1_{k}$ and observe that $$ f^{-1}(V) = \bigcup_{i=1}^n f^{-1}(V) \cap U_i = \bigcup_{i=1}^n \left(f|_{U \cap U_i}\right)^{-1}(V)$$ is open in $U$.