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
(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:
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:
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 $x_{0}\in X$ and let $\Phi:\pi^{-1}(U)\to U\times\mathbb{R}^{k}$ be any smooth local trivialization of $E$ with $f(x_{0})\in U$. By hypothesis, the map $$ \Phi\circ F:(if)^{-1}(U)\to U\times\mathbb{R}^{k} $$ is smooth. Since $\Phi$ commutes with the projection to $U$, we can write $\Phi\circ F(x)=(if(x),\phi_{1}(x),\dots,\phi_{k}(x))$ for $x\in(if)^{-1}(U)$, and the functions $\phi_{1},\dots,\phi_{k}$ are smooth functions on $(if)^{-1}(U)$ (by the smoothness of $\Phi\circ F$). Now the map $\Phi\vert_{S}\circ F_{S}:(if)^{-1}(U)\to(U\cap S)\times\mathbb{R}^{k}$ is given by $x\mapsto(f(x),\phi_{1}(x),\dots,\phi_{k}(x))$, so the restriction of $F_{S}$ to $(if)^{-1}(U)$ is smooth. Thus $F_{S}$ is smooth on a neighbrohood of $x_{0}$. Since $x_{0}$ was arbitrary, we are done.$\square$