About the construction of the restriction of a Vector Bundle in John M. Lee's book There are some details I want to understand in the construction of the Restriction of a Vector bundle given in John M. Lee's book Introduction to Smooth Manifolds. It is given in Example 10.8:

Example 10.8 (Restriction of a Vector bundle). Suppose $\pi:E\to M$ is a rank-$k$ vector bundle and $S\subseteq M$ is any subset. We
  define the restriction of $E$ to $S$ to be the set
  $E|_S=\bigcup_{p\in S}E_p$, with the projection $E|_S\to S$ obtained
  by restricting $\pi$. If $\Phi:\pi^{-1}(U)\to U\times \mathbb{R}^k$ is
  a local trivialization of $E$ over $U\subseteq M$, it restricts to a
  bijective map $\Phi|_U:(\pi|_S)^{-1}(U\cup S)\to (U\cup S)\times
 \mathbb{R}^k$, and it is easy to check that these form local
  trivializations for a vector bundle structure on $E|_S$. If $E$ is a
  smoooth vector bundle and $S\subseteq M$ is an immersed or embedded
  submanifold, it follows easily from the chart lemma that $E|_S$ is a
  smooth vector bundle. In particular, if $S\subseteq M$ is a smooth
  (embedded or immersed) submanifold, then the restricted bundle $TM|_S$
  is called the ambient tangent bundle over $M$.

What topologies do $S$ and $E|_S$ have? At first I thought: "it is obviously the subspace topology", but then at the end of the example, Lee mentions immersed submanifolds which may not have the subspace topology. Then I kinda ran into trouble because I don't know what topology $S$ and $E|_S$ have. We may consider $S$ and $E|_S$ with topologies such that the inclusions $S\hookrightarrow M$, $E|_S\hookrightarrow E$ and the map $\pi|_S:E|_S\to S$ are continuous, but that seems weird. This doesn't have to do with the question, but I believe $\Phi|_U$ should be $\Phi|_S$.
Also, Example 10.28 (b) says

If $E\to M$ is a smooth vector bundle and $S\subseteq M$ is an
  immersed submanifold with or without boundary, then the inclusion map
  $E|_S\hookrightarrow E$ is a smooth bundle homomorphism covering the
  inclusion of $S$ into $M$.

So now we have to prove that the inclusion map $E|_S\hookrightarrow E$ is smooth to begin with. If we only consider embedded submanifolds (which have the subspace topology), then this problem goes away because vector bundles are submersions and thus $E|_S=\pi^{-1}(S)$ is a submanifold of $E$.
There are other subtle issues when considering immersed submanifolds, e.g. Example 10.10 (b):

Given an immersed submanifold $S\subseteq M$ with or without boundary,
  a section of the ambient tangent bundle $TM|_S\to S$ is called a
  vector field along $S$. It is a continuous map $X:S\to TM$ such that
  $X_p\in T_pM$ for each $p\in S$.

If $TM|_S$ is a not a topological subspace of $TM$, then a continuous map $X:S\to TM$ such that $X_p\in T_pM$ doesn't neccesarily give a continuous map $X:S\to TM|_S$ and even worse things can happen when we consider smoothness. Something like this happens in the proof of Lemma 10.35 (Orthogonal Complement Bundles) where $M$ can be a immersed submanifold 
So, in summary, how do we deal with immersed submanifolds? @Jack Lee
 A: (I am not 100% sure, but here's what I believe what the author really meant.)
Short Answer: If $\pi:E\to M$ is a (topological) vector bundle and $S\subseteq M$ is any subspace, then we denote by $E|_S\to S$ the restriction of $\pi:E\to M$ as you have defined. However, when $\pi:E\to M$ is a smooth vector bundle and $S\subseteq M$ is an immersed submanifold, we give $E|_S$ a smooth structure that makes it into an immersed (but possibly not embedded) submanifold of $E$. There is a good reason for this: Even though $E|_S$ may not be embedded in $E$, it has a nice property.

An example of the case where $E|_S$ is not embedded: Let $E=M=\mathbb{R}^2$, and let $\pi=\operatorname{Id}_{\mathbb{R}^2}$. Clearly $\pi:E\to M$ is a smooth vector bundle over $M$ (of rank $0$). Now let $S$ be the figure eight, which is an immersed submanifold in $M$. The chart lemma makes $\pi^{-1}(S)=E|_S$ into an immersed submanifold of $E$. Since $S$ has a self intersection, we cannot make $E|_S$ into a smooth manifold (nor even a topological manifold!) with respect to the subspace topology inherited from $E$. Thus we see that the chart lemma endowed $E|_S$ with a topology different from the subspace topology, i.e., $E|_S$ is not embedded.

Long Answer: Suppose $\pi :E\to M$ is a smooth vector bundle, and let $S$ be an immersed submanifold in $M$. The chart lemma (Lemma 10.6 in Lee's book) shows that $E|_S=\pi^{-1}(S)$ has a (unique) topology and a smooth structure with respect to which the restriction $\pi_S:E|_S\to S$ of $S$ is a smooth vector bundle with the following property:


*

*If $\Phi:\pi^{-1}(U)\to U\times \mathbb{R}^k$ is a smooth local trivialization of $E$ over an open set $U\subseteq M$, then its restriction  $\Phi|_S:\pi^{-1}(U\cap S)\to(U\cap S)\times \mathbb{R}^k$ is a smooth local trivialization of $E|_S$.


It is easy to check that $E|_S$ is an immersed submanifold of $E$.It is also easy to check that in the case when $S$ has the subspace topology inherited from $M$ and is an immersed submanifold of $M$ (i.e., when $S$ is embedded), the topology of $E|_S$ given by the chart lemma agrees with the subspace topology inherited from $E$, so there is no conflict in what the symbol $E|_S$ means in this case. If $S$ is merely immersed, the chart lemma may endow $E|_S$ with a topology different from the subspace topology, so there is a little bit of ambiguity in what the symbol $E_S$ means. However, when $S$ is immersed but not embedded, we are keenly aware of the fact that it is is not "part of $M$", in the sense that it does not have the subspace topology. So there is little chance of confusion.
Although it may not be embedded in $E$, it resembles an embedded submanifold in the following sense: 

If $\sigma:S\to E$ is a smooth map such that
  $\pi\circ\sigma=\operatorname{Id}_S$, then $\sigma:S\to E|_S$ is a
  smooth section. (You can replace "smooth" by "continuous" here.)

Before we get to the proof, let me note that this property explains justifies the arguments in Example 10.10 and lemma 10.35. Now we get back to the proof.
(Proof.) Let $p$ be any point in $S$. Let $\Phi:\pi^{-1}(U)\to U\times\mathbb{R}^k$ be any smooth local trivialization of $E$ with $p\in U$. By hypotheis, the map $$\Phi\circ\sigma:U\cap S\to U\times\mathbb{R}^k$$
is smooth. This, along with the hypothesis that $\pi\circ\sigma=\operatorname{Id}_S$, implies that there are smooth functions $\sigma^i:U\cap S\to \mathbb{R}$ such that $\Phi\circ\sigma(q)=(q,\sigma^1(q),\dots,\sigma^k(q))$ for $q\in U$. Now $\Phi|_S\circ\sigma:\pi^{-1}(U\cap S)\to(U\cap S)\times\mathbb{R}^k$ is given by exactly the same formula: $$\Phi|_S\circ\sigma(q)=(q,\sigma^1(q),\dots,\sigma^k(q)).$$ The smoothness of $(\sigma^i)$ implies that $\Phi|_S\circ\sigma$ is smooth, so the restriction of $\sigma$ to $U\cap S$ is smooth. Since $p$ was arbitrary, the claim follows.$\square$
A: 2nd Edit 20/06/2019 THIS ANSWER HAS A MISTAKE IN EXAMPLE 10.8* (AND THEREFORE IN THE REST BECAUSE IT DEPENDS ON IT), $\pi|_S:E|_S\to S$ NEED NOT BE CONTINUOUS WHEN $S$ IS MERELY IMMERSED AND $E|_S$ HAS THE SUBSPACE TOPOLOGY.
Edit 20/06/2019: Both @Jack Lee and @Ken think $E|_S$ might not have have the subspace topology. I still think it has, so I'm gonna write the details about this in Example 10.8*. If there are any mistakes, I would like you guys to point them out in the comments.
I think I arrived at a satisfactory answer. Lee is essentially right, immersed manifolds can be considered, but I'd like to explain it a little bit more.
Example 10.8* (Restriction of a vector bundle). Suppose $\pi:E\to M$ is a rank-$k$ vector bundle and $S\subseteq M$ is a subset with a topology such that the inclusion map $S\hookrightarrow M$ is a topological immersion (defined after Theorem 4.25). We define the restriction of $E$ to $S$ to be the set $E|_S=\bigcup_{p\in S}E_p$ with the subspace topology and the projection $\pi|_S:E|_S\to S$ is obtained by restricting $\pi$. Let $p\in S$. If $\Phi:\pi^{-1}(U)\to U\times \mathbb{R}^k$ is a local trivialization of $E$ over $U\subseteq M$ with $p\in U$ and $V$ a neighborhood of $p$ in $S$ such that $V\hookrightarrow M$ is a topological embedding, by restricting $\Phi$ we can obtain a bijective map  $\Phi|_S:(\pi|_S)^{-1}(U\cap V)\to (U\cap V)\times \mathbb{R}^k$, and since the topology on $U\cap V$ is given by the subspace topology of $S$ and the subspace topology of $M$ are the same (because $V\hookrightarrow M$ is a topological embedding) and $E|_S$ is a subspace of $E$, we can check that these form local trivializations for a vector bundle structure on $E|_S$. 
If $E$ is a smooth vector bundle and $S\subseteq M$ is an immersed or embedded submanifold, it follows easily from the chart lemma than $E|_S$ is a smooth vector bundle. We now verify that the topology on $E|_S$ given by the chart lemma is the subspace topology. We do this by proving that the identity map $id:E|_S\to E|_S$, where the domain has the subspace topology and the codomain has the topology given by the chart lemma, is a bijective local homeomorphism, and thus a homeomorphism. It is obvious that $id$ is bijective. Let $v\in E_p$ where $p\in S$. Pick $U$ and $V$ as in the previous paragraph, such that $p \in U\cap V$. In both cases, $\Phi|_S:(\pi|_S)^{-1}(U\cap V)\to (U\cap V)\times \mathbb{R}^k$ is a homeomorphism, thus $id|(\pi|_S)^{-1}(U\cap V)=(\Phi|_S)^{-1}\circ \Phi|_S$ is a homeomorphism and then $id$ is a local homeomorphism. In particular, if $S\subseteq M$ is a smooth (embedded or immersed) submanifold, then the restricted bundle $TM|_S$ is called the ambient tangent bundle over $M$.
Example 10.28(b)*. If $E\to M$ is a smoooth vector bundle and $S\subseteq M$ is an immersed submanifold with or without boundary, then it is easy to prove that the inclusion map $E|_S\hookrightarrow E$ is an smooth immersion, and since $E|_S$ has the subspace topology, it is actually an smooth embedding and $E|_S$ is an embedded submanifold of $E$. Thus the inclusion map $E|_S\hookrightarrow E$ is a smooth bundle homomorphism covering the inclusion of $S$ into $M$.
Example 10.10(b)*. Given an immersed submanifold $S\subseteq M$ with or without boundary, a (smooth) section of the ambient tangent bundle $TM|_S\to S$ is called a (smooth) vector field along $S$. Because $TM|_S$ is an embedded submanifold of $TM$, it is a continuous (respectively smooth) map $X:S\to TM$ such that $X_p\in T_pM$ for each $p\in S$.
As an application of all of this. I would like to prove the following theorem
Theorem. If $S\subseteq M$ is an immersed submanifold, then $di:TS\to TM$ is an embedding where $i:S\hookrightarrow M$ is the inclusion map.
Proof. From the coordinate representation of $di$ given in the proof of Proposition 3.21, we see that $di$ is an immersion. Set $n=\dim M$ and $k=\dim S$. Let $p\in S$ and set $D_q=di_q(T_qS)$ for $q\in S$. Since $i$ is a local embedding, there is a neighborhood $V$ of $p$ in $S$ such that the inclusion map $V\hookrightarrow M$ is a smooth embedding. Let $(U,(x^i))$ be a slice chart for $V$ with $p\in U$. Then $\left(\frac{\partial}{\partial x^i}:U\cap V\to TM|_S\right)_{i=1,\dots,k}$ are smooth local sections with the property that $\frac{\partial}{\partial x^1}|_q,\dots,\frac{\partial}{\partial x^k}|_q$ for a basis of $D_q$ for each $q\in U\cap V$. Thus by Theorem 10.32, $di(TS)=\bigcup_{p\in S}di_p(T_pS)$ is a smooth subbundle of $TM|_S$. Since $di(TS)$ is an embedded submanifold of $TM|_S$, we can consider the smooth map $di:TS\to di(TS)$ which is also bijective and an immersion. Thus by the Global Rank Theorem, $di:TS\to di(TS)$ is a diffeomorphism and hence $di:TS\to TM$ is an embedding.
