Let $X,Y$ be topological spaces and $C(X,Y)$ the set of continuous functions from $X$ to $Y$ equipped with the compact open topology. It has a subbase consisting of sets $$V(K,U):=\{f\in C(X,Y)\ |\ f(K)\subset U \}$$ for compact $K\subset X$ and open $U\subset Y$.
Moreover define $Y_x:=Y$ for any $x\in X$ and let $Y^X:=\prod_{x\in X} Y_x$ be the cartesian product equipped with the product topology. For projections $p_x:Y^X\rightarrow Y_x,\ (y_{x'})_{x'\in X}\mapsto y_x$, there is a subbase consisting of sets $$p_x^{-1}(U)$$ for $x\in X$ and open $U\subset Y$.
I want to prove that the inclusion $$\iota:C(X,Y)\rightarrow Y^X$$ is continuous.
Since $\{p_x^{-1}(U):x\in X, U\text{ open in }Y\}$ is a subbase of $Y^X$, it is enough to show, that $\iota^{-1}(p_x^{-1}(U))$ is open for any $x\in X$ and open $U\subset Y$. However, I do not understand how I can use the subbase of compact open topology to show that $\iota^{-1}(p_x^{-1}(U))$ is open in $C(X,Y)$. I probably have to use some compactness argument, but I am not sure, if there is any information missing for the space $X$ and $Y$?
Any hint or help is appreciated! Thank you in advance!
As you know, $\iota$ is continuous if and only all $\iota_x = p_x \circ \iota$ are continuous.
We shall show that $\iota_x$ is continuous in each $f \in C(X,Y)$; this proves that $\iota_x$ is continuous.
Let $U$ be an open neighborhood of $\iota_x(f) = f(x)$ in $Y$. The set $V_f = V(\{x\}, U)$ is an open neighborhood of $f$ in $C(X,Y)$. For $g \in V_f$ we have $\iota_x(f) = g(x) \in V$, thus $\iota_x(V_f) \subset U$. Hence $\iota_x$ is continuous in $f$.