Let $X,Y,Z$ be Hausdorff spaces and suppose that $Z\subset X$. Endow $C(X,Y)$ and $C(Z,Y)$ with the compact-open topologies and define the map $\rho$ as
\begin{align}
\rho:&C(X,Y)\rightarrow C(Z,Y)\\
&f\mapsto f|\_Z.
\end{align}


Is the map $\rho$ continuous?


I see this "type of" operation used all the time in Sheaf theory but I never stopped to wonder if it was indeed continuous?



Continuity of the Restriction Map Between Function Spaces
If $K$ is compact in $Z$ and $U$ open in $Y$, then $K$ is still compact as 
a subset of $X$ as well (compactness is absolute, or maybe use that $i[K]$ is compact where $i: Z \to X$ is the continuous canonical embedding..)


$\rho^{-1}[[K,U]]=\{f \in C(X,Y)\mid (f\restriction\_Z)[K] \subseteq U\} = \{f \in C(X,Y)\mid f[K] \subseteq U\} =[K,U]$ which is open in $C(X,Y)$ by definition. As the sets $[K,U]$ form a subbase for $C(Z,Y)$, $\rho$ is continuous.


