Problem: Is $\mathbb{Q}$ a deformation retract of an open set $U$ in $\mathbb{R}$?
Approach: Enumerate rationals by $q_1,q_2,q_3...$ For each $i$, choose an open set $U_i$ of $q_i$ that deformation retracts onto $U_i$ and such that $U_i\cap U_j= \varnothing$. Put $U=\bigcup_{i=1}^{\infty}U_i$. Then $U$ deformation retracts to $\mathbb{Q}$.
Is this proof right?
Not all $U_i$ can be pairwise disjoint in your construction. That is because each $U_i$ contains more than $1$ rational.
Moreover $\mathbb{Q}$ cannot be a retract of any open subset of $\mathbb{R}$. One of the reasons is that retractions are quotient maps. And quotient maps preserve local connectedness. And open subsets of $\mathbb{R}$ are locally connected while $\mathbb{Q}$ is not.