I read from notes that a semi-algebraic set in $\mathbb{R}^n$ is a set that can be given by finitely many polynomial equalities and inequalities.
It is a finite union of sets of the form $\{x \in \mathbb{R}^n: f(x)=0,g_{i}(x) \gt0\} $
Does it mean if I find an element in the semi-algebraic set, then it is a set constitutes of elements satisfying the polynomials $f(x)=0$ and $g(x) \gt0$? Are these polynomials $f$ and $g$ arbitrary (for all polynomials), or just exist such polynomials (exist such polynomials)?
Finally, it says that the semialgebraic set on real numbers is the finite union of intervals and points. Could you please help me to explain why intervals and points satisfy above conditions?
I don't understand what you are asking in the third paragraph of your question. But I can answer the question in the fourth paragraph, and maybe this will help you understand the definition and clarify your question.
A point in $\mathbb{R}^1$ is a singleton $\{a\}$. This set is defined as $\{x\in \mathbb{R}^1 : x-a = 0\}$ (here the polynomial $f$ is $f(x) = x-a$ and there are no polynomials $g_i$).
An (open) interval in $\mathbb{R}^1$ is $(a,b)$ or $(a,\infty)$ or $(-\infty,b)$, with $a<b$ in $\mathbb{R}$. These sets are defined by \begin{align*} (a,\infty) &= \{x\in \mathbb{R}^1 : x-a>0\}\\ (-\infty,b) &= \{x\in \mathbb{R}^1 : b-x>0\}\\ (a,b) &= \{x\in \mathbb{R}^1 : x-a>0, b-x>0\} \end{align*} In all three, there is no polynomial $f$ (or you can take $f(x) = 0$, so the condition $0 = 0$ is trivially satisfied), in the first we have $g_1(x) = x-a$, in the second we have $g_1(x) = b-x$, and in the third we have $g_1(x) = x-a$ and $g_2(x) = b-x$.
Now if $X\subseteq \mathbb{R}^1$ is a finite union of intervals and points, then it is a finite union of sets defined by polynomial equations and inequalities, so it is semi-algebraic.