Preperiodic points for rational functions defined over a global field in terms of good reduction