Let $U \subseteq I$ be an open set (but not all of $I$), and assume that $0 \in U.$ Show that there is a number $a \in (0,1]$ such that $U = [0,a) \bigcup W,$ where $W$ is also open in $I$ and $W \bigcap [0,a) = \emptyset.$
My trial:
I know that every open set in $\mathbb{R}$ is a union of disjoint open intervals. I also know that we have 3 types of intervals an interval that is totally outside the interval $[0,1]$ from left, an interval that extends before and after $0$ by a small number say $\frac{-1}{n}$ and $\frac{1}{n}$ where $n \geq 1$ and a third interval that $(\frac{1}{n}, 1]$ but I do not know how to choose $a$ and $W$ in all these cases. I also know that a space $X$ is connected if the only separations of $X$ are the trivial ones(I am not sure how this may help here). Could anyone help me formulate a rigorous proof for this please?
Since $U$ is open and $0 \in U$ there exists $t>0$ such that $[0,t) \subseteq U$. Let $a=\sup \{t: [0,t) \subseteq U\}$. Let $W=(a,1]\cap U$. Can you verify that this satisfies the requirements?
[You will have to show that $a \notin U$. Prove this by contradiction].