If $f: X \times Y \to Z$ is continuous, is $x \mapsto f(x,y)$ continuous for every $y \in Y$? Let $X, Y$ and $Z$  be topological spaces and let $f: X \times Y \to Z$. (Here, $X \times Y$ is equipped with the usual product topology.) For each $y \in Y$, define $f_y: X \to Z$ by $ f_y(x) := f(x,y)$ for all $x \in X$.
My questions:

*

*If $f$ is continuous and $\{y\}$ is closed in $Y$, is $f_y$ continuous?

*If (1) is true, do we need the assumption that $\{y\}$ is closed in $Y$ for $f_y$ to be continuous?

I believe (1) is true; here is my proof attempt:
Suppose $f: X \times Y \to Z$ is continuous. Fix $y \in Y$ and suppose $\{y\}$ is closed in $Y$. Let $C \subseteq Z$ be closed in $Z$. Then
\begin{align*}
   (f_y)^{-1}(C) &= \{x \in X: f_y(x) \in C \}  \\[4pt]
                 &= \{x \in X: f(x,y) \in C \}  \\[4pt]  
                 &= \{X \times \{y\}: f(x,y) \in C \}  \\[4pt]
                 &= f^{-1}(C) \cap (X \times \{y\})
\end{align*}
Now $f^{-1}(C)$ is closed in $X \times Y$ because $f$ is continuous, and $X \times \{y\}$ is closed in $X \times Y$ because $X$ is closed in $X$ and $\{y\}$ is closed in $Y$. Therefore $f^{-1}(C) \cap (X \times \{y\}) = f^{-1}(C)$ is closed in $X \times Y$, since an intersection of closed sets is closed. Hence, $f_y$ is continuous. 
Does the proof look OK? 

Edit 11/14/2022: I realized my "proof" is wrong, as $f^{-1}(C)$ and $X \times \{y\}$ are subsets of $X \times Y$, but $(f_y)^{-1}(C)$ should be an open subset of $X$. 
Thanks to @belkacem abderrahmane and @Danny Pak-Keung Chan for their replies. I give here my paraphrasing of Belkacem's proof. First, a lemma:
Lemma: Let $X$ and $Y$ be topological spaces. For each $y \in Y$, the function $g_y: X \to X \times Y$ defined by
$$ g_y(x) := (x,y), \qquad x \in X  $$
is continuous.
Proof. Fix $y \in Y$ and fix a product open subset $A \times B$ of $X \times Y$. Then
\begin{align*}
    (g_y)^{-1}(A \times B) &= \{x \in X: g_y(x) \in A \times B \} \\[4pt]
    &= \{x \in X: (x,y) \in A \times B \} \\[4pt]
    &= 
    \begin{cases}
        A & \text{if } y \in B \\[4pt]
        \emptyset & \text{if } y \notin B.
    \end{cases}
\end{align*}
Since $A$ and $\emptyset$ are both open in $X$, it follows that $(g_y)^{-1}(A \times B)$ is open in $X$. Then since the product open subsets of $X \times Y$ form a basis for the product topology on $X \times Y$, it follows that $g_y$ is continuous. $\qquad \square$ 
Now to answer my original question: 
Proposition: Let $X, Y$ and $Z$  be topological spaces and let $f: X \times Y \to Z$. For each $y \in Y$, the function $f_y: X \to Z$ defined by
$$f_y(x) := f(x,y)$$
is continuous. 
Proof. Fix $y \in Y$ and let $g_y: X \to X \times Y$ be as in the lemma. Then for each $x \in X$, we have
$$ f_y(x) = f(x,y) = f(g_y(x)). $$
Thus, $f_y = f \circ g_y$. Since $g_y$ is continuous by the lemma and $f$ is continuous by assumption, it follows that their composition $f_y$ is continuous. $\qquad \square$

As an aside, I came to this question while starting to learn about homotopy from Introduction to Topological Manifolds by John Lee. The author mentions on p.184 that

A homotopy defines a one-parameter family of continous maps $H_t: X \to Y$ for $0 \leq t \leq 1$ by $H_t(x) = H(x,t)$...

Here is the author's definition of homotopy:

Let $X$ and $Y$ be topological spaces, and let $f,g: X \to Y$ be continuous maps. A homotopy from $f$ to $g$ is a continuous map $H: X \times I$ (where $I = [0,1]$ is the unit interval) such that for all $x \in X$,
$$ H(x,0) = f(x); \qquad H(x,1) = g(x). $$

So it seems the author is using the above claim about continuity of "slices" for the case $Y = I = [0,1]$ (in which case, each singleton $\{y\}$ is closed in $I = [0,1]$).
 A: $f_{y}$ is always continuous as long as $f$ is continuous, i.e.,
the condition that $\{y\}$ is closed in $Y$ is not needed.
Proof: Fix $a\in X$ and $y\in Y$. We go to show that $f_{y}$ is
continuous at $a$. Let $W$ be an arbitary open neighborhood of $f(a,y)\in Z$,
then there exists an open neighborhood $U$ for $(a,y)\in X\times Y$
such that $f(U)\subseteq Z$. Recall that $\{\cap_{i=1}^{n}\left(A_{i}\times B_{i}\right)\mid n\in\mathbb{N},A_{i}\subseteq X,\,B_{i}\subseteq Y\,\mbox{are open}\}$
is a base for the product topology on $X\times Y$, so we can find
$U_{0}=\cap_{i=1}^{n}\left(A_{i}\times B_{i}\right)$, where $A_{i}\subseteq X$ and $B_{i}\subseteq Y$ are open, such that $(a,y)\in U_{0}\subseteq U$. Let $A=\cap_{i=1}^{n}A$, which is an open neighborhood of $a$. ($A$
is trivially open. Moreover, $(a,y)\in U_{0}\Rightarrow a\in A_{i}$
for all $i$, so $a\in A$. ) Now, let $x\in A$ be arbitrary. We
have that $(x,y)\in U_{0}$, so $f_{y}(x)=f((x,y))\in Z$. This shows
that $f_{y}$ is continuous at $a$. Since $a\in X$ is arbitrary,
$f_{y}$ is continuous.
A: your proof seems good, another possible approach: For fixed $y$, Consider the  map $$T:X\to X\times Y, x\to (x, y) $$ Then your map is nothing but $f\circ T$, So it is continous since $T$ is continuous (you don't need ${y} $ to be closed) . In fact it's the other direction which isn't true in general, if $f_{y} $ is continuous for every $y$, then it doesn't necessarily follow that $f$ is continous. So one need to be careful, when dealing with homotopy as a family of continuous maps $H_{t} $, because we need continuity in the other variable too, i.e for fixed $x$, $t\to H_{t} (x) $ is a continuous curve. Intuitively, you can think of $t$ as a time, and homotopy as a continuous deformation of one graph into another, see illustration of Homotopy between two curves
