Let $X$ be a locally ringed space. Let $\mathcal{O}$ be its structure sheaf. Let $A = \Gamma(X, \mathcal{O})$. Let $x \in X$. Let $m_x$ be the maximal ideal of $\mathcal{O}_x$. Let $f \in A$. We denote by $f_x$ the image of $f$ by the canonical homomorphism $A \rightarrow \mathcal{O}_x$. We denote by $f(x)$ the image of $f_x$ by the canonical homomorphism $\mathcal{O}_x \rightarrow \mathcal{O}_x/m_x.$ We write $X_f = \{x \in X|\ f(x) \neq 0\}$. Is the following proposition true?
Proposition
(1) $X_f$ is open for every $f \in A$.
(2) Let $f_1,\dots,f_n$ be elements of $A$. Suppose $A = (f_1,\dots,f_n)$ and $X_{f_i}$ is an affine scheme for every $i$. Then $X$ is an affine scheme.
EDIT As Zhen Lin and QiL pointed out, (2) is probably false. However, if $X$ is a Noetherian topological space, (2) is true.
EDIT2 As QiL's edited answer shows, (2) is true after all. I leave the previous EDIT as it is for the sake of honesty.
EDIT3 This is just a remark. Suppose $A = (f_1,\dots,f_n)$. I will show that $X = \bigcup X_{f_i}$. There exist $a_1,\dots,a_n \in A$ such that $1 = a_1f_1 + \cdots + a_nf_n$. Let $x \in X$. Then $1 = a_1(x)f_1(x) + \cdots + a_n(x)f_n(x)$. Hence $f_i(x) \neq 0$ for some $i$. Hence $x \in X_{f_i}$ as desired.