Open subset of a scheme is also a scheme In order to prove that any open subset $(U, \mathcal{O}_X|_U)$ of a scheme $(X,\mathcal{O}_X)$ is a scheme, we have to show the following two materials.
1)  $(U, \mathcal{O}_X|_U)$ is a locally ringed space, namely, each stalk of $\mathcal{O}_X|_U $ is a local ring.
In fact, any germ $<U \cap G, s>$  of $(U, \mathcal{O}_X|_U)$ at the point $p \in U$    is also a germ of  $(X,\mathcal{O}_X)$, there is map between stalk $(\mathcal{O}_X|_{U})_{p } \to \mathcal{O}_{X,p} $. The inverse mapping of this is obvious. Thus, $(\mathcal{O}_X|_{U})_{p } \cong (\mathcal{O}_X)_{p }$ and by the assumption, $(\mathcal{O}_X)_{p }$ is a local ring and thus $(\mathcal{O}_X|_{U})_{p } $ is also  a local ring.
2)Any point of $U$, there is an open neighborhood of $U$ such that it is a spectrum of some ring.
I cannot prove this.
The following is my attempt.
Because any point of $U$ is also a point of $X$ and $X$ is a scheme, there is an open neighborhood $G$ of $X$ (not $U$) such that $G \cong $ Spec $R(G)$ for some ring $R(G)$. Because any open set of $U$  can be written by $U \cap G$, we can obtain an open subset of Spec $R(G)$ which is homeomorphic to  $U\cap G$. However I cannot find a ring $R(G \cap U)$ such that  $U\cap G \cong$  Spec $R(G \cap U)$.   
 A: What you have shown reduces the problem to the case when $X$ itself is affine.
So, let $X=\mathrm{Spec}\,A$ be an affine scheme. Then the distinguished opens $D(a)$ for $a\in A$ form a base for the Zariski topology (and this base is closed under finite intersections). Moreover, we have $D(a)=\mathrm{Spec}\,A_a$, the affine scheme corresponding to the localisation $A_a$.
It follows that if $U\subseteq X$ is any open, then we can write $U$ as a union of distinguished opens. This completes the proof of (2).
A: Answer: The pair $(U, (\mathcal{O}_X)_U)$ is a locally ringed space since the restriction $(\mathcal{O}_X)_U$ of $\mathcal{O}_X$ to the open set $U$ is sheaf of rings with the same stalks as $\mathcal{O}_X$ and these are local rings:
$$((\mathcal{O}_X)_U)_x \cong \mathcal{O}_{X,x}.$$
Given any point $x\in U$ there is an open affine scheme $x\in V:=Spec(A)\subseteq X$ containing $x$. Since $x\in V \cap U$ and since $V\cap U \subseteq V$ is an open set, there is a basic open set $x\in D(f):=Spec(A_f)$ containing $x$. It follows $D(f) \subseteq U$ is open in $U$ and hence $(U, (\mathcal{O}_X)_U)$ has an open cover consisting of affine schemes.
