Continuity within a restricted topology proof 
If f:$(X,\tau_x)\to (Y,\tau_y)$ is continuous and $Z\subset X$, so the restriction of to Z,
$f_{|Z}:(Z,\tau_{X|Z})\to(Y,\tau_{Y})$
is continuous.

I gave a proof of my own but I do not know if I am using the concepts adequately.
As $f$ is continuous, then if $B\in\tau_y$ is an open set, then $f^{-1}(B)\in \tau_x$. If we consider $f^{-1}(B)=A\in \tau_{X|Z}$ then $f^{-1}(B)\in \tau_X$, once $\tau_{X|Z}\subset\tau_X$ which proves $f$ is continuous on the restricted topology.
Question:
Is my proof right? Can I use $\tau_{X|Z}\subset\tau_X$?
If it is wrong. Can someone give me an alternative proof?
Thanks in advance!
 A: There are different problems in your arguments.
Let $\tau_Z$ denote the relative topology of $Z$ with respect to $\tau_X$.
Then you have
$$
\tau_Z=\{A\cap Z~:~A\in\tau_X\}.
$$
If $Z\in \tau_X$ then you can conclude $A\cap Z\in \tau_X$ for all $A\in\tau_X$ hence $$
\tau_Z=\{A\in\tau_X~:~A\subset Z\}\subset \tau_X.
$$
But this is just the special case $Z\in \tau_X$. Otherwise $\tau_Z$  contain subsets of $X$ which are not in $\tau_X$ like $Z$ itself.
I.e. $X=\{0,1,2\}$, $\tau_X=\{\emptyset,\{0\},\{1,2\},X\}$, $Z=\{0,1\}$. You get $\tau_Z=\{\emptyset,\{0\},\{1\},Z\}\not\subseteq\tau_X$ since $\tau_Z\ni\{1\}\notin\tau_X$ and $\tau_Z\ni Z\notin\tau_X$.
For your proof you need to consider $f\mid_Z^{-1}(B)$ for a $B\in \tau_Y$.You get
\begin{align}
f\mid_Z^{-1}(B)&=\{z\in Z~:~f\mid_Z(z)\in B\}=\{z\in Z~:~f(z)\in B\}=\{z\in X~:~z\in Z \wedge f(z)\in B\}\\
&=Z\cap\{z\in X~:~f(z)\in B\}=Z\cap f^{-1}(B)
\end{align}
Since $f^{-1}(B)\in \tau_X$ by continuouty of $f$ we can conclude $f\mid_Z^{-1}(B)\in\tau_Z$ and $f\mid_Z$ is continuous.
A: $\tau_{X|Z}\subseteq\tau_X$ is not true in general. You just need to use the definition of restricted topology: $f_{|Z}^{-1}(B)=f^{-1}(B)\cap Z$, and since a set is an element of $\tau_{X|Z}$ iff it is the restriction of an open set of $X$ to $Z$, it follows that $f_{|Z}^{-1}(B)$ is an open set the restricted topology.
