How to show that explicit generator of the fundamental group is the one I found? I am working on an exercise:
Let $X$ be $\mathbb S^2$ with a straight line segment having the north pole and the south pole as its end points. Compute the fundamental group of $X$ (with the north pole as a base point) of $X$ and find generators.
For the first part, I was able to find that the fundamental group of $X$ is isomorphic to $\mathbb Z$ using Van Campen theorem, and intuitively, I think the generator of the group should be a path that starts from the north pole, goes down the straight line segment, and comes back to the north pole via the path in the sphere, as any path that does not go through the straight line segment would be null homotopic.
However, I am not sure how to rigorously justify that the path I mentioned above is the generator for the fundamental group.
P.S. Also, during my proof for the first part, there was a part where I needed to show that $X \setminus \{ (1, 0, 0) \} \simeq \mathbb S^1$, and I feel like I did not show it rigorously. Is there a way to show this rigorously as well using deformation retraction?
 A: This is too long to post as a comment, so I'm leaving it here instead.
I'm not sure how rigorous an argument you're looking for. Truly rigorous arguments in Algebraic Topology are really hard to write, and are also quite hard to find in the literature. (I have some opinions on this, which I'm putting at the end).
I'll say this, though: If I were grading an algebraic topology class, I would give full credit without hesitation if you said that

*

*$X$ is homotopy equivalent to $S^2 \vee S^1$ (by sliding the south pole to the north pole, say)


*Since $S^2$ is simply connected, we have (by Van Kampen) that $\pi_1X =  \pi_1 S^1 = \mathbb{Z}$. (Maybe with some extra justification here, depending on how recently the theorem was introduced)


*The generator is the loop that we homotoped from the path connecting the poles in $X$. This is easy to see, because we know what the generator is $\pi_1 S^1$ is.


*So we find the generator in $X$ is any old loop that goes through the segment you named (exactly once, of course).
If you're looking for a really rigorous justification, I'm not the right person to give it. Unfortunately, much of Algebraic Topology is hard to really make formal, because you have to make a bunch of choices that don't matter (like a particular path through the sphere connecting the poles to complete your loop). Once you start doing this, the field quickly starts losing its flavor, and a lot of what you're doing is an exercise in analysis instead... HoTT was introduced (in part) to solve these problems. In that setting you can be truly formal, while also reasoning in the way that we do as humans.
All this to say, don't worry too much about being extremely precise. You'll tear your hair out (speaking from experience...) If you really do care about the intricate formalities of what you're doing, then HoTT might be something to look into.

I hope this helps ^_^
