I try to solve exercise 2.19 on page 65 in "Algebraic Geometry I" by U.Görtz/T.Wedhorn. The exercise reads:
Let $(X,O_X)$ be a locally ringed space, and $f\in O_X(X)$. Define $X_f:=\{ x\in X; f(x) \neq 0\}$. Show that $X_f$ is an open subset of $X$. What is $X_f$ if $X$ is an affine scheme?
With regard to the first question I don't know what to do. Isn't it necessary to have more information on the topology to prove this?
If we take $X$ as an affine scheme we can assume $X=\text{Spec}(A)$ for a commutative ring $A$. Then $X_f = D(f) = V(f)^c$ is clearly open. Is that right?