Prove that $x\in P$, then there exists a neighborhood $O$ of $x$ such that $O\subset X$, $P$ is defined in a particular way. I'm reading Intro to Topology by Mendelson.
This is the first section on compact topological spaces.
The complete question is,
Let $\{U_\alpha\}_{\alpha\in I}$ be an open covering of $[0,1]$. Define a subset $P$ of $[0,1]$ as follows: 
$x\in P$ if and only if there exists a finite subcollection of $\{U_\alpha\}_{\alpha\in I}$ that covers $[0,x]$, that is, $[0,x]\subset\bigcup\limits_{i=1}^n U_{\alpha_i}$.
Prove that if $x\in P$ then there exists a neighborhood $O$ of $x$ such that $O\subset P$.
I know that if we let $x\in P$, then for any $0\leq y\leq x$, $y\in P$ since, $[0,y]\subset[0,x]$. I also know that for every $x\in P$, $x\in U_{\alpha_i}$ for some $1\leq i\leq n$. What I'm thinking of showing is that one of the open sets $U_{\alpha_i}$ are in fact the neighborhood contained in $P$, yet I don't quite know how to go about doing this. I'm not even sure if this is the right approach.
Thanks for any hints or feedback!

Suppose $x \in P$, then $[0,x] \subset \cup_{i=1}^n U_{\alpha_i}$. Hence $\exists j \in \{1,2\ldots, n\}$ such that $x \in U_{\alpha_j}$. Since $U_{\alpha_j}$ is open, $\exists \delta > 0$ such that $(x-\delta, x+\delta) \subset U_{\alpha_j}$. Now for any $y \in (x-\delta, x+\delta)$,
$$
[0,y] \subset [0,x+\delta) \subset \cup_{i=1}^n U_{\alpha_i}
$$
Hence, $y \in P$, and so $O = (x-\delta, x+\delta)$ is the open set you are looking for.
