[step:Glue the local product bundles from a cocycle]
Conversely, suppose smooth maps
\begin{align*}
g_{ij}:U_i\cap U_j\to GL(k,\mathbb{R})
\end{align*}
satisfy the identity and cocycle equations. Let
\begin{align*}
X:=\bigsqcup_{i\in I}(U_i\times\mathbb{R}^k)
\end{align*}
be the disjoint union of the local product spaces. Write an element of the $i$-summand as $(i,x,v)$ with $x\in U_i$ and $v\in\mathbb{R}^k$. Define a relation $\sim$ on $X$ by
\begin{align*}
(i,x,v)\sim(j,y,w)
\end{align*}
if and only if $x=y\in U_i\cap U_j$ and
\begin{align*}
v=g_{ij}(x)w.
\end{align*}
The identity $g_{ii}=I_k$ gives reflexivity. If $(i,x,v)\sim(j,x,w)$, then $v=g_{ij}(x)w$; the cocycle identity with indices $j,i,j$ gives $g_{ji}(x)g_{ij}(x)=g_{jj}(x)=I_k$, so $w=g_{ji}(x)v$, proving symmetry. If $(i,x,v)\sim(j,x,w)$ and $(j,x,w)\sim(\ell,x,z)$, then
\begin{align*}
v=g_{ij}(x)w=g_{ij}(x)g_{j\ell}(x)z=g_{i\ell}(x)z,
\end{align*}
so $(i,x,v)\sim(\ell,x,z)$. Thus $\sim$ is an equivalence relation.
Let
\begin{align*}
E_g:=X/{\sim}
\end{align*}
be the quotient set, let $q:X\to E_g$ denote the quotient map, and let $[i,x,v]$ denote the equivalence class of $(i,x,v)$. Give $E_g$ the [quotient topology](/page/Quotient%20Topology) induced by $q$, so a subset $O\subset E_g$ is open exactly when $q^{-1}(O)$ is open in the disjoint union topology on $X$. Define $\pi_g:E_g\to M$ by
\begin{align*}
\pi_g([i,x,v])=x.
\end{align*}
This is well-defined because equivalent triples have the same base point.
For each $i\in I$, define $\psi_i:\pi_g^{-1}(U_i)\to U_i\times\mathbb{R}^k$ by
\begin{align*}
\psi_i([j,x,w])=(x,g_{ij}(x)w),
\end{align*}
where the formula is used only when $x\in U_i\cap U_j$. To check well-definedness, suppose $[j,x,w]=[\ell,x,z]$ with $x\in U_i\cap U_j\cap U_\ell$. Then $w=g_{j\ell}(x)z$, and the cocycle identity gives
\begin{align*}
g_{ij}(x)w=g_{ij}(x)g_{j\ell}(x)z=g_{i\ell}(x)z.
\end{align*}
Thus the value of $\psi_i$ is independent of the representative. The map $\psi_i$ is bijective, with inverse $\psi_i^{-1}:U_i\times\mathbb{R}^k\to \pi_g^{-1}(U_i)$ given by
\begin{align*}
\psi_i^{-1}(x,v)=[i,x,v].
\end{align*}
Indeed, $\psi_i([i,x,v])=(x,v)$ because $g_{ii}=I_k$, and if $\psi_i([j,x,w])=(x,v)$, then $v=g_{ij}(x)w$, so $[j,x,w]=[i,x,v]$ by the defining equivalence relation.
The sets $\pi_g^{-1}(U_i)$ cover $E_g$. They are open because
\begin{align*}
q^{-1}(\pi_g^{-1}(U_i))=\bigsqcup_{j\in I}\bigl((U_i\cap U_j)\times\mathbb{R}^k\bigr),
\end{align*}
which is open in the disjoint union topology on $X$. The quotient topology and the explicit inverse above make each $\psi_i$ a homeomorphism: on the $j$-summand over $U_i\cap U_j$, the map $\psi_i\circ q$ is
\begin{align*}
(x,w)\mapsto (x,g_{ij}(x)w),
\end{align*}
which is continuous, and the inverse is induced by the continuous inclusion of the $i$-summand followed by $q$.
On overlaps,
\begin{align*}
\psi_i\circ\psi_j^{-1}(x,v)=(x,g_{ij}(x)v),
\end{align*}
which is a smooth map on $(U_i\cap U_j)\times\mathbb{R}^k$ because $g_{ij}$ is smooth and matrix multiplication against a vector is smooth. Therefore the charts $(\pi_g^{-1}(U_i),\psi_i)$ define a smooth atlas on $E_g$. We verify the topological manifold conditions. The space $E_g$ is Hausdorff: if two classes have different base points, separate their base points by disjoint open subsets of $M$ and take their inverse images under $\pi_g$; if they have the same base point, choose an index $i$ with that base point in $U_i$ and separate their distinct fiber coordinates inside the product chart $\psi_i$. It is second-countable because $M$ is second-countable, hence the open cover has a countable subcover $(U_{i_m})_{m\in\mathbb{N}}$, and the product manifolds $U_{i_m}\times\mathbb{R}^k$ have countable bases whose images under the homeomorphisms $\psi_{i_m}^{-1}$ form a countable basis for $E_g$. Thus $E_g$ is a smooth manifold with the displayed atlas.
In these charts, $\pi_g$ is represented by the smooth projection map from $U_i\times\mathbb{R}^k$ to $U_i$, and the transition maps are fiberwise linear. Hence $\pi_g:E_g\to M$ is a smooth rank-$k$ real vector bundle and the $\psi_i$ are smooth vector bundle trivialisations. The fiberwise [vector space](/page/Vector%20Space) operations are well-defined because each $g_{ij}(x)$ is linear.
[/step]