What you write is true, only you have to be a bit more careful with the definitions and the arguments. The inclusion mapping doesn't always have to be a smooth immersion and the statement that "the derivative of the inclusion is the identity transformation" and this doesn't make sense in general. Let me state a definition and then provide some examples:
Let $(M,\tau_M, \mathcal{A}_M)$ be a smooth manifold. An immersed submanifold of $M$ is a triple $(X,\tau_X, \mathcal{A}_X)$ where:
- The set $X$ is a subset of $M$.
- The set $\tau_X$ is a topology on $X$ making $(X,\tau_X)$ a topological manifold.
- The set $\mathcal{A}_X$ is a collection of charts on $(X,\tau_X)$ which defines a smooth structure on $X$.
such that the inclusion map $i \colon (X,\tau_x,\mathcal{A}_X) \rightarrow (M,\tau_M,\mathcal{A}_M)$ is a smooth immersion (and in particular, it is continuous).
Consider the following "artificial" examples:
- Let $M = \mathbb{R}$ with the standard topology and smooth structure. Choose some subset $X \subseteq M$ for which there exists a bijection $\varphi \colon X \rightarrow \mathbb{R}^2$ (as sets!). Use the map $\varphi$ to endow $X$ with a topology $\tau_X$ and a smooth structure $\mathcal{A}_X$ that turns $\varphi$ into a diffeomorphism. Then $(X,\tau_X, \mathcal{A}_X)$ satisfies the first three properties above but the inclusion map is not continuous and in particular can't be a smooth immersion.
- Let $M = \mathbb{R}^2$ with the standard topology and smooth structure and let $X = \{ (x, |x|) \, | \, |x| < 1 \}$. Let $\tau_X$ be the subspace topology on $X$ and consider the map $\varphi \colon \mathbb{R} \rightarrow \mathbb{R}^2$ given by
$$ \varphi(x) = \begin{cases}
\left( -e^{-\frac{1}{x^2}}, e^{-\frac{1}{x^2}} \right) & -\infty < x < 0, \\
(0,0) & x = 0, \\
\left( e^{-\frac{1}{x^2}}, e^{-\frac{1}{x^2}} \right). & 0 < x < \infty
\end{cases}$$
You can verify that $\varphi$ is a smooth map with $\varphi(\mathbb{R}) = X$ and that $\varphi$ is a homeomorphism onto $(X,\tau_X)$ . Use the map $\varphi$ to endow $(X,\tau_X)$ with a smooth structure $\mathcal{A}_X$ that turns $\varphi$ into a diffeomorphism. Then $(X,\tau_X,\mathcal{A}_X)$ satisfies the first three properties and the inclusion is a smooth homeomorphism onto the image but it is not an immersion at $(0,0)$. In fact, Lee shows that the set $X$ cannot be endowed with a topology $\tau_X$ and smooth structure $\mathcal{A}_X$ making $(X,\tau_X,\mathcal{A}_X)$ into an immersed submanifold.
I wrote this a while ago, and now I kind of having difficulty to follow my proof. But I'm sure I convinced by this proof at the time I wrote this. Let me know if something unclear.
Setup : Let $ \pi|_S : TM|_S \to S$ be the ambient tangent bundle, $\iota : S \hookrightarrow M$ is an immersed submanifold of dimension $k$ of a $n$-dimensional smooth manifold $M$. For any $p \in S$, we have an $k$-dimensional subspace $d\iota_p (T_pS) \subseteq T_pM$. We want to show that $\bigcup_{p \in S} d\iota_p(T_pS) \subseteq TM|_S$ is a smooth subbundle of rank-$k$. To do this, it is enough to show that for any $p \in S$ there is a neighbourhood $V$ of $p$ and smooth local sections $\sigma_1,\dots,\sigma_k :V \to TM|_S$ such that at any $q \in V$, $\sigma_1(q),\dots,\sigma_k(q)$ form a basis for subspace $d\iota_q(T_qS)$.
Proof : Since $S \subseteq M$ is an immersed submanifold, then $S$ locally embedded. So for any $p \in S$, there exists a neighbourhood $V \subseteq S$ of $p$ such that $V$ is embedded submanifold of $M$. By shrinking $V$ if necessary, we may assume that $V \subseteq S$ such that $\iota(V)=V \subseteq U$, so $V = V \cap U$ is a single slice in $U$, where $(U,\varphi)$ is a slice chart for $V$. That is
$$
\varphi(V) = \{(x^1,\dots,x^n) \in \varphi(U) : x^{m+1} = \cdots= x^n = 0 \} \subseteq \varphi(U).
$$
By Theorem 5.8, we have smooth (global) chart $(V,\psi)$ where the coordinate functions $\psi (V) = \{ (x^1,\dots,x^m)\} \subseteq \mathbb{R}^m$ are exactly the nonvanishing coordinates of image $\varphi(V)$ in $\varphi(U)$. Hence the representation of $\iota : S \hookrightarrow M$ in smooth charts $(V,\psi)$ and $(U,\varphi)$ is
\begin{equation}\tag{$\star$}
(x^1,\dots,x^m) \mapsto (x^1,\dots,x^m,0,\dots,0).
\end{equation}
Now for $i=1,\dots,m$, the coordinate vector fields $\tau_i : V \to TS$ defined as $\tau_i(q) = \frac{\partial}{\partial x^i}\big|_q$ are smooth local frame (since the component functions are constant, hence smooth) for $TS$ over $V$. Define local sections $\sigma_i : V \to TM|_S$ defined as $\sigma_i(q) = d\iota_q (\tau_i(q))$, for $i =1,\dots,m$, where $d\iota_q : T_qS \to T_qM$ is the differential of $\iota : S \hookrightarrow M$ at $q\in S$. From ($\star$), we can compute $\sigma_i$ as
$$
\sigma_i(q) = d\iota_q \circ \tau_i(q) = d\iota_q \Big(\frac{\partial}{\partial x^i}\bigg|_q \Big) = \frac{\partial}{\partial x^i}\bigg|_q,
$$
which is form a basis for $d\iota_q(T_qS) \subseteq T_qM$.
We have to show that these sections are smooth sections on $TM|_S$. Since $\sigma_i (V) \subseteq \bigcup_{q \in V} T_qM = (\pi|_S)^{-1}(V) = TM|_V$ and $TM|_V$ is open in $TM|_S$, then we only need to check the smoothness in $TM|_V$. For the local trivialization of $TM$ over slice chart $U$ as above is $\Phi : \pi^{-1}(U) \to U \times \mathbb{R}^n$, defined as
$$
\Phi \Big(v^i \frac{\partial}{\partial x^i}\Big|_p \Big) = (p,(v^1,\dots,v^n)).
$$
So the local trivialization for $TM|_V$ is just the restriction of $\Phi$ to $\pi^{-1}(U \cap V)$. Denote this as $\Psi = \Phi|_U : \pi^{-1}(U \cap V) \to (U \cap V) \times \mathbb{R}^n$. Therefore
$$
\Psi \circ \sigma_i (q) =\Phi(\sigma_i(q)) =(q,e_i),
$$
which is obviously smooth. Hence $\sigma_i$ are the smooth local sections tha we seek. Since we can do this for every point $p \in S$, therefore $TS$ identified as its image $d\iota(TS) \subseteq TM|_S$ is a smooth subbundle.
Best Answer
Your first answer is right: with your definition, a tangent vector acts on functions defined on the whole manifold. But, since its action is local, extending a given function by the use of a bump function will still result in the wanted behaviour around the point you are watching.
Your functions $f^j=\varphi\times x^j$, $j>k$, vanishes on whole $S$, because in $U\cap S$, the coordinates $x^j$ $(j>k)$ vanishes, and outside $U$ it is $\varphi$ who does.