let ##X=\{0,p1,p_2,...,p_n,1\}## and ##Y=\{0,p1,p_2,...,p_n,1\}## be sets equipped with the discrete topology.
for each ##q_i## in ##Y##, the inverse image ##h^{-1}(q_i)=p_i## is open in ##X## w.r.t. to the discrete topology, so h is continuous.
every element y in Y has a preimage x in X, so h...