Let $\Sigma_g$ be the orientable surface of genus $g$ and $N_{g+1}$ be the non-orientable surface of genus $g+1$. Assume that $\Sigma_g$ is embedded inside $\mathbb{R}^{3}$ such that it admits the antipodal action. We can prove that the quotient of $\Sigma_g$ by the antipodal action is $N_{g+1}$. Let $X=\frac{\Sigma_g\times \mathbb{R}}{(x,t)\sim(-x,-t)}$. Observe that $\mathbb{R}\to X\to N_{g+1}$ is the line bundle.
I have started reading the book on Characteristic classes by Milnor and Stasheff. I am finding difficulties to compute the first Stiefel-Whitney class of this line bundle. Can anyone help me to understand this? If $g=0$, then it is clear that the first Stiefel-Whitney class is the generator of $H^1(\mathbb{R}P^2;\mathbb{Z}_2)\cong \mathbb{Z}_2$.
To save on typing, I'll write for $G$ for $\mathbb{Z}/2\mathbb{Z}$ for the duration of this post.
Let me start with a more general approach. Suppose $p:M\rightarrow N$ is a $2$-fold covering map, where $M$ and $N$ are any reasonably nice topological spaces.
Then one can form the space $E_p:=M\times \mathbb{R}/\sim$ where a point $(m,t)\in M\times \mathbb{R}$ is identified with $(m', -t)$, where $m'$ refers to the unique other point in $p^{-1}(p(m))$. The projection $p$ descends to map (which I'll still write as $p$) $p:E_p\rightarrow N$ giving $E_p$ the structure of a rank $1$ real vector bundle over $N$.
Proposition: Consider the bundle $q:S^\infty\rightarrow \mathbb{R}P^\infty$. Then $E_q = S^\infty\times \mathbb{R}/\sim$ is isomorphic to the tautological bundle over $\mathbb{R}P^\infty$.
Proof: Because $H^1(\mathbb{R}P^\infty;G)\cong G$, there are only two rank $1$ bundles over $\mathbb{R}P^\infty$. Thus, it is enough to show that this bundle is non-trivial. To that end, we consider the sphere bundle inside of it: $S^\infty \times S^0/\sim$. In the trivial bundle, this sphere bundle is disconnected, but in the case of our bundle, it is connected. Indeed, if $\gamma:[0,1]\rightarrow S^\infty$ is any path connecting antipodal points (meaning $-\gamma(0) = \gamma(1)$, then the path $\alpha:[0,1]\rightarrow S^\infty\times S^0/\sim$ given by $\alpha(t) = [(\gamma(t),1)]$ satisfies $\alpha(0) = [(\gamma(0),1)]$ while $\alpha(1) = [(\gamma(1),1)] = [(-\gamma(0),1)] = [(\gamma(0),-1)]$. $\square$
Returning to the more general case, $p$ induces a map $p_\ast: \pi_1(M)\rightarrow \pi_1(N)$. Since $p$ is a $2$-fold covering map, the image $p_\ast(\pi_1(M))\subseteq \pi_1(N)$ is index $2$. Thus, we have a map $\phi:\pi_1(N)\rightarrow \pi_1(N)/(p_\ast(\pi_1(M))) \cong G$.
Proposition. Under the identification $H^1(N;G)\cong \operatorname{Hom}(H_1(N);G)\cong \operatorname{Hom}(\pi_1(N);G)$, the map $\phi$ corresponds to $w_1(E_p\rightarrow N)$.
Proof. The bundle $q:S^\infty\rightarrow \mathbb{R}P^\infty$ is the universal $G$-bundle, so the covering $p:M\rightarrow N$ is classified by a map $i:N\rightarrow \mathbb{R}P^\infty$, so we obtain a commutative diagram \begin{array} A\mathbb{Z}/2\mathbb{Z} & {\longrightarrow} & \mathbb{Z}/2\mathbb{Z} \\ \downarrow{} & & \downarrow{} \\ M & \stackrel{j}{\longrightarrow} & S^\infty\\ \downarrow{} & & \downarrow{} \\ N& \stackrel{i}{\longrightarrow} & \mathbb{R}P^\infty \end{array}
Where the bottom vertical maps are bundle projections.
It's not hard to see that $j$ extends to a map $E_p\rightarrow E_q$, so $i$ pulls back $E_q$ to $E_p$. But from our first proposition, $E_q$ is the tautological bundle on $\mathbb{R}P^\infty$. S0, $i$ not only classifies the double cover, but also the vector bundle $E_p$. In particular, the map $i^\ast:H^1(\mathbb{R}P^\infty;G)\rightarrow H^1(N;G)$ has the property that $i^\ast(z) = w_1(E_p\rightarrow N)$, where $z$ generates $H^1(\mathbb{R}P^\infty;G)$. We must now determine $i^\ast(z)$.
Returning to the diagram of fibrations above, we obtain long exact sequence in homotopy groups, a portion of which looks like \begin{array} A0 & \longrightarrow & \pi_1(M) &\longrightarrow & \pi_1(N) & \stackrel{\phi}{\longrightarrow} &\mathbb{Z}/2\mathbb{Z} &\longrightarrow & 0 \\ \downarrow & & \downarrow & & \downarrow{i_\ast} && \downarrow{Id} && \downarrow\\ 0 & \longrightarrow & 0 & \longrightarrow & \mathbb{Z}/2\mathbb{Z} & \stackrel{Id}{\longrightarrow} & \mathbb{Z}/2\mathbb{Z} & \longrightarrow & 0 \end{array}
Commutativity tells us that $Id\circ \phi = Id \circ i_\ast$, so $\phi = i_\ast$. As $H_1$ is the abelianization of $\pi_1$, it also follows that $\phi = i_\ast$ when considered as maps on $H_1$.
Finally, we turn to the universal coefficients theorem for cohomlogy. We obtain a commutative diagram \begin{array} AH^1(\mathbb{R}P^\infty;G) & \stackrel{i^\ast}{\longrightarrow} & H^1(N;G) \\ \downarrow{h} & & \downarrow{h} \\ \operatorname{Hom}(H_1(\mathbb{R}P^\infty;G) & \stackrel{-\circ i_\ast}{\longrightarrow} & \operatorname{Hom}(H_1(N);G) \end{array}
The Ext terms vanish since $H_0$ is free, so the vertical maps in this diagram are isomorphisms. In addition, since $i_\ast = \phi$ on $H_1$, the bottom map can be replaced with $-\circ \phi$.
Then $h(w_1(E_p\rightarrow N)) = h(i^\ast(z)) =h(z) \circ \phi$. But $h(z)$ is the non-trivial element of $\operatorname{Hom}(H_1(\mathbb{R}P^\infty),G)$, i.e., the non-trivial element of $\operatorname{Hom}(G,G)\cong G$, i.e., $h(z) = Id$ Thus, we have identified $w_1(E_p\rightarrow N)$ with $\phi$. $\square$
So, what does this all mean for your specific example? Well, if we pick a simple curve connecting a point on $\Sigma_g$ to its antipodal point, the projection into $N_{g+1}$ gives a closed curve whose whose image in $H_1(N)$ projects to a non-trivial element of $G$ via $\phi$. Then $w_1$ is the cohomology class dual to this curve.