If $G$ is an open subset of $R$, and if $x\in G$, show that there exists a largest open interval $I_x$ containing $x$ s.t $I_x$ is the subset of $G$.
My idea:
Let $x\in (a_x,b_x)$ where
$a_x=\inf\{a<x|(a,x)\subset G \}$ and
$b_x=\sup\{b>x|(x,b)\subset G \}$.
Let $I_x=(a_x,b_x)$.
I want to show $a_x$, $b_x$ can not belong to G, hence $I_x$ is the largest interval.
Assume $a_x\in G$, this contradicts the fact that $a_x$ was $\inf$. so $a_x$ is not in $G$. Likewise for $b_x$.
I think if it was said that $G$ is bounded, I could confidently use the proof idea above. But it is NOT. So what if G is unbounded? Then I may not have finite $a_x$ and $b_x$. Or do I need to be worried about this at all?
One way to think about this is use the following fact.
Every open set in $\mathbf{R}$ can be written as a countable union of pairwise disjoint open intervals. So we get $$G=\bigcup_{i=1}^{\infty}I_i$$ Let $x \in G \implies \exists! n\in\mathbf{N} $ so that $x\in I_n$
Now you can check that this interval will be your maximal interval containing $x$ that's contained in $G$.