For $x,y$ $\in$ $[0,1]$, let $$d(x,y)= \begin{cases} |x-y|, & \text{if $x-y \in \mathbb{Q} $} \\[2ex] 2, & \text{if $x-y \notin \mathbb{Q}$} \end{cases}$$ where $\mathbb{Q}$ is a set of rational numbers. Find if $d$ is a metric in $[0,1]$.
So what I've already done is:
1) $d(x,y)=0$ iff $x=y \Rightarrow$ $d(x,x)=|x-x|=0$ because $x-x=0 \in \mathbb{Q} $
2) $d(x,y)=d(y,x) \Rightarrow$
2.1) if $x-y \in \mathbb{Q} $ and $y-x \in \mathbb{Q}$ then $|x-y|=|y-x|$,
2.2) if $x-y \notin \mathbb{Q} $ and $y-x \notin \mathbb{Q} $ then $2=2$ - ok
2.3) if $x-y \in \mathbb{Q} $ and $y-x \notin \mathbb{Q} $ then $|x-y|=2$ $\Rightarrow x=y+2$ or $x=y-2$
2.4) if $x-y \notin \mathbb{Q} $ and $y-x \in \mathbb{Q} $ then $2=|y-x|$ $\Rightarrow x=y+2$ or $x=y-2$
3) $d(x,y) \le d(x,z) + d(z,y) \,,\forall x,y,z\in \mathbb{Q} \Rightarrow$
So do I have to write all of these and prove inequalities like: $|x-y| \le |x-z| + |z-y|$ or is there any other option?
If anyone can help me with the 3rd condition and check all the previous ones, if I didn't make any mistakes (or is it wrong?), I would be really thankful.