A line $g$ is given in a plane. $n$ distinct points are chosen arbitrarily from $g$ and are named as $A_1, A_2, \ldots, A_n$. For each pair of points $A_i,A_j$, a semicircle is drawn with $A_i$ and $A_j$ as its endpoints. All semicircles lie on the same side of $g$. Determine the maximum number of points (which are not lying in $g$) of intersection of semicircles as a function of $n$.
1. **Understanding the Problem:**
   We are given a line \( g \) and \( n \) distinct points \( A_1, A_2, \ldots, A_n \) on \( g \). For each pair of points \( A_i \) and \( A_j \), a semicircle is drawn with \( A_i \) and \( A_j \) as its endpoints, and all semicircles lie on the same side of \( g \). We need to determine the maximum number of intersection points of these semicircles that do not lie on \( g \).

2. **Analyzing Semicircle Intersections:**
   Consider two semicircles with endpoints \( A_i, A_j \) and \( A_k, A_l \). These two semicircles will intersect at most twice, once above the line \( g \) and once below it. Since all semicircles lie on the same side of \( g \), we only consider intersections above \( g \).

3. **Counting Intersections:**
   To find the maximum number of intersection points, we need to count how many distinct pairs of semicircles can be formed from \( n \) points. Each pair of points \( (A_i, A_j) \) forms a semicircle, and we need to count the intersections of these semicircles.

4. **Choosing Pairs of Semicircles:**
   The number of ways to choose 2 semicircles from \( n \) points is given by the combination formula \( \binom{n}{2} \). However, we need to consider the intersections of these semicircles. For each set of 4 points, there is exactly one intersection point of the semicircles formed by these points.

5. **Calculating Maximum Intersections:**
   The maximum number of intersection points occurs when no two pairs of semicircles intersect at the same point. This is equivalent to choosing 4 points out of \( n \) and forming intersections. The number of ways to choose 4 points from \( n \) is given by \( \binom{n}{4} \).

\[
\text{Maximum number of intersection points} = \binom{n}{4}
\]

6. **Conclusion:**
   The maximum number of points of intersection of the semicircles, which do not lie on \( g \), is given by \( \binom{n}{4} \).

The final answer is \( \boxed{ \binom{n}{4} } \)