Let $S=\{1-\frac{(-1)^n}{n}:n\in\mathbb{N}\}$ and $\inf S=\frac{1}{2}$ by observation.
I am trying to rigorously show the the infimum of $S$ indeed $\frac{1}{2}$
First, $\frac{1}{2}$ is the lower bound for $S$ by observation.
Now, remains to show for all $\epsilon>0$, there exist $x\in S$ such that $x<\frac{1}{2}+\epsilon$.
In other words, $1-\frac{(-1)^n}{n}<0.5+\epsilon$ for some $n\in\mathbb{N}$.
Re-arrange we have
$$\frac{1}{2}<\frac{(-1)^n+n\epsilon}{n}$$
If $n$ is odd:
$$ n<-2+2n\epsilon\\ \frac{2}{2\epsilon -1}<n $$
Now if I check this conclusion by letting $\epsilon=0.1$, the LHS is negative value and $n$ can takes the smallest odd natural number $1$. And this is not the case that
$$ 1-\frac{(-1)^n}{n}<0.5+\epsilon\\ 2=1-\frac{(-1)^1}{1}<0.5+0.1 $$
Where does it go wrong? and how to rigorously show this question?
When going from $n<-2+2n\epsilon$ to $\frac{2}{2\epsilon -1}<n$ you divide by $2\epsilon - 1$. For small values of $\epsilon>0$ that quantity is negative, and thus dividing by it changes the direction of the inequality. What you should have is $$\frac{2}{2\epsilon -1}>n$$ and as you note, the LHS can be negative, so this inequality will no hold for any $n$. But this inequality was derived from assuming $n$ is odd, so you can conclude that the $n$ you are looking for is even. Indeed, note that $$S'=\left\{1-\frac{(-1)^n}{n}:n\in\mathbb{N} \text{ and $n$ is odd}\right\} =\left\{2,1+\frac{1}{3}, 1+\frac{1}{5}, \ldots \right\}$$ and $\inf S' \neq \frac{1}{2}$.