For a function, the first element in $X$ has $20$ choices (to map to) and the second element also has $20$ choices. For a one-to-one function the second element has only $19$ choices left after $1$ being taken by the first. So, required probability
$=\frac {(20 \times 19)} {(20 \times 20)} = 0.95$