Show that The path components of $Map(X,Y)$, equipped with compact-open topology with a subbasis $$ \mathcal{O}_{K,U}:=\{f\in Map(X,Y): f(K)\subseteq U\},$$ is one to one corresponding to $[X,Y]$, the set of homotopy classes between $X$ and $Y$.
My attempt: Let $f,g\in Map(X,Y)$. We need to show $f,g$ are in the same path component iff $f\simeq g$.
$\Rightarrow $: Suppose $\phi:I\rightarrow Map(X,Y)$ is a path from $f$ to $g$. We define $$ \begin{aligned} H:X\times I&\rightarrow Y\\ (x,t)&\mapsto \phi(t)(x)\end{aligned}$$ We need to show $H$ is continuous. Let $V$ be an open subset of $Y$, we check $H^{-1}(V)$.
Step1: $(x,t)\in H^{-1}(V)$ means $$ \phi(t)(x)\in U \Leftrightarrow \phi(t)\in \mathcal{O}_{\{x\},V}\Leftrightarrow t\in \phi^{-1}( \mathcal{O}_{\{x\},V})$$ Since $\phi$ is continuous, $\phi^{-1}( \mathcal{O}_{\{x\},V}))$ is open, therefore we can choose an open interval $(a_x,b_x)$, such that $$t\in (a_x,b_x)\subseteq \phi^{-1}(\mathcal{O}_{\{x\},U})$$ So we have shown that $$(x,t)\in H^{-1}(V)\Rightarrow \{x\}\times (a_x,b_x)\subseteq H^{-1}(V)$$
Step2: $(x,t)\in H^{-1}(V)$ means $$x\in (\phi(t))^{-1}(V)$$ Therefore we can find a neighborhood of $x$, say $U_t$, such that $$(x,t)\in H^{-1}(V)\Rightarrow U_t\times \{t\}\subseteq H^{-1}(V)$$
I have no idea how to proceed. It seems that I have exhausted all the properties of $\phi$. Can I conclude that $H^{-1}(V)$ is open just from step1 and step2?
By the way, the other direction is much easier.
THANKS!