If $\displaystyle f: (M_1,d_1)\to(M_2,d_2)$ is continuous and $\displaystyle N_1$ is a vector subspace of $\displaystyle M_1$ then $\displaystyle f\bigg|_{N_1}(N_1,d_1)\to (M_2,d_2)$ is continuous.

How does one prove continuity with $\displaystyle f$ restricted into a set?

Let $\displaystyle f: (M_1,d_1)\to (M_2,d_2)$ be continuous and $\displaystyle f(M_1)\subseteq N_2\subseteq M_2$ then $\displaystyle f: (M_1,d_1)\to(N_2,d_2)$ is continuous.

I need a hint for this one.

Thanks.