Let X = R and $d$ the standard metric on it. That is, if $x, y \in \mathbb{R}$, then $d(x, y) = |x - y|$.
Show that
$d'(x, y) = \begin{cases} \min\{|x - y|, 1\} & \text{if } x, y \in \mathbb{Q} \text{ or } x, y \in \mathbb{R} \\ \mathbb{Q} \\ 1 & \text{otherwise} \end{cases}$
is also a metric.
Does it generate the same topology on R as $d$?
If not, how are the two topologies related? One contains the other? Neither?