You have your definition backwards. Given an $\epsilon$ you must find a $\delta$.

In this case suppose $\epsilon < |x| \in \mathbb{Q}$

As irrationals are dense in $\mathbb{Q}$ any $\delta$ neighborhood about x contains an irrational number c and so $\forall \delta > 0~~\exists c \in (x-\delta, x+\delta) \ni |f(x)-f(c)|=|x-0|=|x|$

and thus

$|f(x)-f(c)| > \epsilon$ and thus $f$ is discontinuous at $x$.

Likewise as rationals are dense in $\mathbb{R}$ any $\delta$ neighborhood about an irrational number x contains a rational number c and the result is the same.