[proofplan]
Both parts reduce to verifying that preimages of open sets are open, using the definition of the subspace topology. For part 1, the preimage of an open set under $f|_A$ equals the intersection of $A$ with the preimage under $f$, which is open in $A$ by the subspace topology. For part 2, we factor the corestriction through the inclusion and use the characterisation of open sets in $B$: every open set in $B$ has the form $V \cap B$ for some open $V$ in $Y$, and its preimage under the corestriction is the preimage of $V$ under $f|_A$ intersected with the constraint $f(a) \in B$.
[/proofplan]
[step:Prove continuity of the restriction $f|_A$]
Let $V$ be open in $Y$. We must show that $(f|_A)^{-1}(V)$ is open in $A$. By definition of the restriction,
\begin{align*}
(f|_A)^{-1}(V) = \{ a \in A : f|_A(a) \in V \} = \{ a \in A : f(a) \in V \} = f^{-1}(V) \cap A.
\end{align*}
Since $f: X \to Y$ is continuous, $f^{-1}(V)$ is open in $X$. By the definition of the subspace topology on $A$, the set $f^{-1}(V) \cap A$ is open in $A$. Hence $f|_A$ is continuous.
[guided]
We verify continuity of $f|_A: A \to Y$ using the open-preimage characterisation: a map is continuous if and only if the preimage of every open set is open.
Let $V$ be an arbitrary open set in $Y$. The preimage under the restriction is
\begin{align*}
(f|_A)^{-1}(V) = \{ a \in A : f(a) \in V \} = A \cap f^{-1}(V).
\end{align*}
The second equality holds because $f|_A$ and $f$ agree on $A$: for $a \in A$, $f|_A(a) = f(a)$.
Now we use both hypotheses. The continuity of $f: X \to Y$ ensures $f^{-1}(V)$ is open in $X$. The subspace topology on $A$ is $\tau_A = \{U \cap A : U \in \tau_X\}$, so $f^{-1}(V) \cap A$ is open in $A$.
Since $V$ was arbitrary, $f|_A$ is continuous. This argument shows that the subspace topology on $A$ is precisely designed so that the inclusion map $\iota_A: A \hookrightarrow X$ is continuous, and composing a continuous map with a continuous map yields a continuous map. Indeed, $f|_A = f \circ \iota_A$.
[/guided]
[/step]
[step:Prove continuity of the corestriction $f|_A^B$]
Let $W$ be open in $B$. By the definition of the subspace topology on $B$, there exists an open set $V$ in $Y$ with $W = V \cap B$. The preimage under the corestriction is
\begin{align*}
(f|_A^B)^{-1}(W) = \{ a \in A : f(a) \in W \} = \{ a \in A : f(a) \in V \cap B \}.
\end{align*}
Since $f(A) \subset B$ by hypothesis, for any $a \in A$ we have $f(a) \in B$ automatically. Therefore the condition $f(a) \in V \cap B$ reduces to $f(a) \in V$:
\begin{align*}
(f|_A^B)^{-1}(W) = \{ a \in A : f(a) \in V \} = (f|_A)^{-1}(V).
\end{align*}
By part 1, $f|_A: A \to Y$ is continuous, so $(f|_A)^{-1}(V)$ is open in $A$. Hence $(f|_A^B)^{-1}(W)$ is open in $A$, and $f|_A^B$ is continuous.
[guided]
The corestriction $f|_A^B: A \to B$ is the same function rule as $f|_A$, but with codomain restricted from $Y$ to $B$. This changes which sets count as "open in the codomain," so continuity does not follow from part 1 without further argument.
Let $W$ be open in $B$. By the subspace topology on $B \subset Y$, we can write $W = V \cap B$ for some $V$ open in $Y$. The preimage is
\begin{align*}
(f|_A^B)^{-1}(W) &= \{ a \in A : f(a) \in W \} = \{ a \in A : f(a) \in V \cap B \}.
\end{align*}
Now the hypothesis $f(A) \subset B$ is consumed: since every $a \in A$ satisfies $f(a) \in B$, the condition $f(a) \in V \cap B$ is equivalent to $f(a) \in V$. Hence
\begin{align*}
(f|_A^B)^{-1}(W) = \{ a \in A : f(a) \in V \} = (f|_A)^{-1}(V).
\end{align*}
By part 1, $f|_A$ is continuous, so $(f|_A)^{-1}(V)$ is open in $A$. Since $W$ was an arbitrary open set in $B$, the corestriction $f|_A^B$ is continuous.
Why is the hypothesis $f(A) \subset B$ essential? Without it, $f|_A^B$ is not even well-defined as a function into $B$. But even if we weaken the statement to ask about preimages, the reduction $(f|_A^B)^{-1}(V \cap B) = (f|_A)^{-1}(V)$ would fail: the left side would exclude points $a \in A$ with $f(a) \in V \setminus B$, introducing an additional constraint that need not produce an open set.
[/guided]
[/step]