I am trying understand the proof of the following (proposition 1.4 in Hatcher's book on Vector Bundle).
For every vector bundle $E\overset{p}{\to} B$, with $B$ compact Hausdorff, there exists a vector bundle $E'\to B$ such that $E\oplus E'$ is the trivial bundle.
In the proof, using Urysohn's lemma, a map $\phi_x:B\to[0,1]$ is constructed, such that $\phi_x|_{B\setminus U_x}=0$ and $\phi_x(x)\ne 0$, where $(U_x,h_x)$ is a local trivialization of $x$. Then using compactness of $B$ we have a finite collection, say, $\{(U_i,\phi_i)\}_{i=1}^k$. A map $g_i:p^{-1}(U_i)\to\mathbb{R}^n$ is defined by, $$g_i(v)=(\phi_i\circ p(v)) (\pi_i\circ h_i(v))$$ where, $\pi_i:U_i\times\mathbb{R}^n\to\mathbb{R}^n$ is the projection.
Then a new map $g:E\to\mathbb{R}^{nk}$ is defined by $g=(g_1,\ldots,g_k)$.
What I cannot understand here, how this map $g$ makes sense? The component $g_i$ is not even defined everywhere on the total space $E$. I can define $g_i$ to be $0$ outside of $p^{-1}(U_i)$, since $\phi_i\circ p$ will be $0$ in that complement. But then I cannot show that with this definition $g_i$ is continuous.
Any help about this is appreciated. Thanks.
As you suggest, you can (and should) define $g_i$ to be $0$ outside $E_i=p^{-1}(U_i)$. This is called extension by zero. For this extension to be continuous, the maps $\phi_x$ need to satisfy a condition a tiny bit stronger then $\phi_x|_{B\setminus U_x}=0$. Namely, we need to require$$\mathrm{supp}(\phi_x)\subset U_x.$$Then $g_i$ is continuous both on $E_i$ and $E\setminus p^{-1}(\mathrm{supp}(\phi_i))$, hence continuous on $E$.