[proofplan]
We construct the pullback bundle by pulling each local trivialisation of $E$ back along $f$. If $\varphi_i:\pi^{-1}(U_i)\to U_i\times\mathbb R^r$ trivialises $E$, then over $V_i=f^{-1}(U_i)$ the corresponding map sends $(n,e)$ to $(n,\operatorname{pr}_2(\varphi_i(e)))$. The transition maps are exactly the original transition maps of $E$ evaluated at $f(n)$, so they are smooth by composition with the smooth map $f$. These pulled-back charts define the smooth structure and make the projection to $N$ a [smooth vector bundle](/page/Smooth%20Vector%20Bundle) of the same rank.
[/proofplan]
[step:Construct the pullback projection and its candidate local trivialisations]
Let
\begin{align*}
f^*E := \{(n,e) \in N \times E : f(n)=\pi(e)\}
\end{align*}
and define the projection map
\begin{align*}
\rho: f^*E \to N, \qquad (n,e) \mapsto n
\end{align*}
For each $n \in N$, the fiber of $\rho$ over $n$ is
\begin{align*}
\rho^{-1}(\{n\}) = \{n\}\times E_{f(n)}
\end{align*}
We give this fiber the [vector space](/page/Vector%20Space) structure transported from the vector space $E_{f(n)}$ by the bijection $e \mapsto (n,e)$.
Let $\{U_i\}_{i\in I}$ be an [open cover](/page/Open%20Cover) of $M$ by [vector bundle](/page/Vector%20Bundle) trivialisation domains for $E$. For each $i\in I$, let
\begin{align*}
\varphi_i:\pi^{-1}(U_i) \to U_i\times \mathbb R^r
\end{align*}
be a smooth vector bundle trivialisation of $E$ over $U_i$. Define
\begin{align*}
a_i:\pi^{-1}(U_i) \to \mathbb R^r, \qquad e \mapsto \operatorname{pr}_2(\varphi_i(e))
\end{align*}
where $\operatorname{pr}_2:U_i\times \mathbb R^r\to\mathbb R^r$ is projection onto the second factor.
For each $i\in I$, define
\begin{align*}
V_i := f^{-1}(U_i) \subset N
\end{align*}
Since $f$ is smooth, it is continuous, so each $V_i$ is open in $N$. The sets $\{V_i\}_{i\in I}$ cover $N$ because the sets $\{U_i\}_{i\in I}$ cover $M$. Define
\begin{align*}
\Psi_i:\rho^{-1}(V_i) \to V_i\times \mathbb R^r, \qquad (n,e)\mapsto (n,a_i(e))
\end{align*}
This is the candidate local trivialisation of $f^*E$ over $V_i$.
[/step]
[step:Verify that the pulled-back local maps are fiberwise linear bijections]
Fix $i\in I$. Define
\begin{align*}
\Theta_i:V_i\times\mathbb R^r \to \rho^{-1}(V_i), \qquad (n,v)\mapsto (n,\varphi_i^{-1}(f(n),v))
\end{align*}
This map is well-defined: if $n\in V_i$, then $f(n)\in U_i$, so $\varphi_i^{-1}(f(n),v)\in \pi^{-1}(U_i)$ and
\begin{align*}
\pi(\varphi_i^{-1}(f(n),v))=f(n)
\end{align*}
Hence $(n,\varphi_i^{-1}(f(n),v))\in f^*E$.
For $(n,e)\in \rho^{-1}(V_i)$, write $\varphi_i(e)=(f(n),a_i(e))$, since $\pi(e)=f(n)$. Then
\begin{align*}
\Theta_i(\Psi_i(n,e))=(n,\varphi_i^{-1}(f(n),a_i(e)))=(n,e)
\end{align*}
For $(n,v)\in V_i\times\mathbb R^r$,
\begin{align*}
\Psi_i(\Theta_i(n,v))=(n,v)
\end{align*}
Thus $\Psi_i$ is a bijection with inverse $\Theta_i$.
For each fixed $n\in V_i$, the restriction
\begin{align*}
\Psi_i\big|_{\rho^{-1}(\{n\})}:\rho^{-1}(\{n\}) \to \{n\}\times\mathbb R^r
\end{align*}
is given by $(n,e)\mapsto(n,a_i(e))$. Since $\varphi_i$ is a vector bundle trivialisation, its restriction $E_{f(n)}\to\{f(n)\}\times\mathbb R^r$ is linear. Therefore $\Psi_i$ is linear on every fiber.
[/step]
[step:Compute the transition maps and prove that they are smooth]
Let $i,j\in I$ and let
\begin{align*}
V_{ij}:=V_i\cap V_j=f^{-1}(U_i\cap U_j)
\end{align*}
Let $GL_r(\mathbb R)=\{A\in\mathbb R^{r\times r}:\det A\neq 0\}$ denote the Lie group of invertible linear maps $\mathbb R^r\to\mathbb R^r$, equivalently invertible real $r\times r$ matrices. On the overlap $U_i\cap U_j$, the transition function of $E$ is the smooth map
\begin{align*}
g_{ji}:U_i\cap U_j \to GL_r(\mathbb R)
\end{align*}
defined by the identity
\begin{align*}
\varphi_j(\varphi_i^{-1}(m,v))=(m,g_{ji}(m)v)
\end{align*}
for every $m\in U_i\cap U_j$ and every $v\in\mathbb R^r$.
For $(n,v)\in V_{ij}\times\mathbb R^r$, the transition map between the pulled-back trivialisations is
\begin{align*}
\Psi_j\circ\Psi_i^{-1}(n,v)=(n,g_{ji}(f(n))v).
\end{align*}
The map $f|_{V_{ij}}:V_{ij}\to U_i\cap U_j$ is smooth, and $g_{ji}$ is smooth because it is a vector bundle transition function of $E$. Hence
\begin{align*}
g_{ji}\circ f|_{V_{ij}}:V_{ij}\to GL_r(\mathbb R)
\end{align*}
is smooth. Since the matrix action map
\begin{align*}
GL_r(\mathbb R)\times\mathbb R^r &\to \mathbb R^r, \qquad (A,v)\mapsto Av
\end{align*}
is smooth, the map
\begin{align*}
V_{ij}\times\mathbb R^r &\to V_{ij}\times\mathbb R^r, \qquad (n,v)\mapsto(n,g_{ji}(f(n))v)
\end{align*}
is smooth.
[guided]
The point of this step is to check compatibility of the local models. A collection of bijections to $V_i\times\mathbb R^r$ gives a smooth vector bundle atlas only if the coordinate changes are smooth and fiberwise linear. Recall that the pulled-back local map is
\begin{align*}
\Psi_i:\rho^{-1}(V_i) &\to V_i\times\mathbb R^r, \qquad (n,e)\mapsto (n,\operatorname{pr}_2(\varphi_i(e))).
\end{align*}
Fix two indices $i,j\in I$. Their overlap in the base $N$ is
\begin{align*}
V_{ij}:=V_i\cap V_j=f^{-1}(U_i\cap U_j).
\end{align*}
The original bundle $E\to M$ has smooth transition functions. Concretely, there is a smooth map
\begin{align*}
g_{ji}:U_i\cap U_j &\to GL_r(\mathbb R)
\end{align*}
such that for every $m\in U_i\cap U_j$ and every $v\in\mathbb R^r$,
\begin{align*}
\varphi_j(\varphi_i^{-1}(m,v))=(m,g_{ji}(m)v).
\end{align*}
This formula says that changing from the $i$-trivialisation to the $j$-trivialisation leaves the base point $m$ unchanged and acts on the fiber coordinate by the invertible matrix $g_{ji}(m)$.
Now compute the corresponding change of coordinates for $f^*E$. Start with $(n,v)\in V_{ij}\times\mathbb R^r$. Applying $\Psi_i^{-1}$ gives
\begin{align*}
\Psi_i^{-1}(n,v)=(n,\varphi_i^{-1}(f(n),v)).
\end{align*}
Applying $\Psi_j$ to this pair means taking the second component of $\varphi_j$ applied to $\varphi_i^{-1}(f(n),v)$. Since $f(n)\in U_i\cap U_j$, the transition formula for $E$ applies with $m=f(n)$, giving
\begin{align*}
\varphi_j(\varphi_i^{-1}(f(n),v))=(f(n),g_{ji}(f(n))v).
\end{align*}
Therefore
\begin{align*}
\Psi_j\circ\Psi_i^{-1}(n,v)=(n,g_{ji}(f(n))v).
\end{align*}
This formula is smooth for two reasons. First, $f|_{V_{ij}}:V_{ij}\to U_i\cap U_j$ is smooth because $f$ is smooth and $V_{ij}$ is an open submanifold of $N$. Second, $g_{ji}:U_i\cap U_j\to GL_r(\mathbb R)$ is smooth by the definition of a smooth vector bundle atlas. Thus $g_{ji}\circ f|_{V_{ij}}$ is a smooth $GL_r(\mathbb R)$-valued map. Composing it with the smooth matrix action
\begin{align*}
GL_r(\mathbb R)\times\mathbb R^r &\to \mathbb R^r, \qquad (A,v)\mapsto Av
\end{align*}
shows that
\begin{align*}
(n,v)\mapsto(n,g_{ji}(f(n))v)
\end{align*}
is a smooth map from $V_{ij}\times\mathbb R^r$ to itself. The same formula also shows fiberwise linearity, because for each fixed $n$, the map $v\mapsto g_{ji}(f(n))v$ is linear.
[/guided]
[/step]
[step:Use the pulled-back atlas to define the smooth vector bundle structure]
The preceding transition computation shows that the family of bijections
\begin{align*}
\Psi_i:\rho^{-1}(V_i) &\to V_i\times\mathbb R^r
\end{align*}
has smooth transition maps on every overlap. Therefore the standard smooth-atlas construction gives a unique smooth structure on $f^*E$ for which every $\Psi_i$ is a diffeomorphism onto the [smooth manifold](/page/Smooth%20Manifold) $V_i\times\mathbb R^r$. Since $N$ is second-countable, the open cover $\{V_i\}_{i\in I}$ has a countable subcover, and the corresponding pulled-back charts give a countable basis because each $V_i\times\mathbb R^r$ is second-countable. The resulting space is Hausdorff: two points in the same chart are separated inside $V_i\times\mathbb R^r$, while two points over distinct base points are separated by inverse images under $\rho$ of disjoint coordinate neighbourhoods in the Hausdorff manifold $N$.
With this smooth structure, the projection $\rho:f^*E\to N$ is smooth because in the local chart $\Psi_i$ it is the ordinary projection
\begin{align*}
V_i\times\mathbb R^r &\to V_i, \qquad (n,v)\mapsto n.
\end{align*}
Each local map $\Psi_i$ is fiber-preserving and linear on fibers, as verified above. Hence $\rho:f^*E\to N$ is a smooth real vector bundle. Its fibers are modeled on $\mathbb R^r$, so its rank is $r$.
[/step]
[step:Identify the naturality of the construction]
For every $n\in N$, the fiber of the constructed bundle over $n$ is
\begin{align*}
(f^*E)_n=\rho^{-1}(\{n\})=\{n\}\times E_{f(n)}.
\end{align*}
The map
\begin{align*}
\{n\}\times E_{f(n)} &\to E_{f(n)}, \qquad (n,e)\mapsto e
\end{align*}
is a canonical linear isomorphism. Thus the construction uses only the original bundle projection $\pi:E\to M$, the smooth map $f:N\to M$, and the transition functions of the given vector bundle atlas on $E$. This proves that $f^*E$ carries the asserted natural smooth vector bundle structure of rank $r$ over $N$.
[/step]