Let $U = \mathbb{R}\setminus \mathbb{Z}$. Is $U$ open in $\mathbb{R}$?
My attempt: $U = \mathbb{R}\setminus \mathbb{Z}$ is open in $\mathbb{R}$: Let $x\in U$. Choose $r:=\frac{1}{2}(\text{min}\{x-\lfloor x \rfloor, (\lfloor x \rfloor+1) -x\})$, so $r>0$. Therefore for each $x\in U$ there exist $r>0$ such that $(x-r, x+r)\subset U$. Hence $\mathbb{R}\setminus \mathbb{Z}$ is open in $\mathbb{R}$.
Is my proof correct?