Theorem: Let (X, t) and (Y, u) be topological spaces, let (A, tA) be a subspace of (X, t) and let (B, uB) be a subspace of (Y, u). Theorem: Let $(X, t)$ and $(Y, u)$ be topological spaces, let $(A, t_A)$ be a subspace of $(X, t)$ and let $(B, u_B)$ be a subspace of $(Y, u)$. If $f:X\to B$ is continuous, then the function $g:X\to Y$ defined by $g(x) = f(x)$ for each $x \in X$ is continuous.  This is a theorem in my textbook but isn't proved.  I'm not sure why this is true since we only know that $X\to B$ is continuous but $B$ is a subset of $Y$.  I'm thinking that this has to do with a property of projections since that is how we've been proving topologies are continuous but not exactly sure of the details or specifics.
 A: You have for any subspace $B$ of $Y$ a so-called inclusion map 
$$i:B\to Y\\ i(b)=b$$
The way the subspace topology on $B$ is defined, $i$ is a continuous map.  
Now if $f:X\to B$ is continuous, then since compositions of continuous maps are continuous, so is
$$X\xrightarrow{f} B\xrightarrow{i} Y$$
There is even more we can say. We can define the topology on $B$ via the map $i$. The subspace topology on $B$ is then the coarsest topology on $B$ making $i$ continuous. This topology must consists of all the sets $i^{-1}(U)$ for open $U$ in $Y$ (It must contain all those preimages in order to be continuous, and as we want the coarsest such topology, we do not add any set other than these). It is then easy to show that a  map $f:X\to B$ is continuous if $i\circ f$ is continuous. This actually works for any map $g:B\to Y$ where $B$ is an arbitrary space.
So in the end, $f$ is continuous $X\to B$ iff it is continuous as a map $X\to Y$.
A: It's just because the image of $f$ (and so of $g$) is completely contained in $B$, and open sets in $B$ are precisely open sets in $Y$ intersected with $B$.
So if $U$ is open in $Y$, then $V=U\cap B$ is open in $B$. Then $g^{-1}(U)=g^{-1}(V)=f^{-1}(V)$ is open in $X$ since $f$ is continuous. Thus $g$ is continuous as desired.
