I know that a random variable is a measurable function from some measurable space $(\Omega, \mathscr{F})$ to some borel space $(R, \mathscr{B})$.
Suppose I am given some random sample $X_1, ..., X_n$. From the definition of a random sample, each $X_i:\Omega \rightarrow R$ are a measurable function with common domain the sample space $\Omega$.
I know that the sample mean is a random variable. Hence it is a measurable function.
So what type of function is the sample mean exactly? From which measurable space to where? And what exactly does the notation $\bar{X} = n^-1 \sum _i^n X_i$ mean given that it does not mean that $\bar{X} (s)= n^{-1} \sum _i^n X_i(s)$?
I ask because usually defining a function $f$ by $f = v+g$ where $g:A \rightarrow R, v:A \rightarrow R$ implies that $f(x) = v(x) + g(x) \forall x \in A$ holds.
With this setup the sample mean is another measurable function $\Omega \to \mathbb{R}$ and it is just given by $\bar{X}(s) = \frac{1}{n} \sum_{i=1}^n X_i(s)$. The entire subtlety of this question, which you've glossed over, is how one actually defines the sample space $\Omega$ and the functions $X_i$ in it in general!
For example, suppose I want the $X_i$ to be $n$ independent samples from a normal distribution $N(\mu, \sigma)$. What is the sample space? It is not the sample space $\mathbb{R}$ of a single sample from a normal distribution. In fact it is $\mathbb{R}^n$, the product of $n$ copies of the sample space of a single sample, equipped with the product measure, and the $X_i$ are the $n$ coordinate projections $\mathbb{R}^n \to \mathbb{R}$. This construction is how we guarantee independence. So the sample mean is again another function $\mathbb{R}^n \to \mathbb{R}$ given by the mean of the $n$ coordinates.
Generally - and this is a surprisingly subtle point I've only seen explained well by Terence Tao, here and here - thinking of random variables as measurable functions on a fixed sample space is something of a distraction, because in probability theory we always retain the freedom to enlarge the sample space as necessary to accommodate new sources of randomness (e.g. in this case adding another sample $X_{n+1}$). As Tao says:
And:
The sample space and measurable function are analogous to a representation of a group; it's a "representation" of a random variable, not the invariant content of the random variable itself (given by its CDF or its moments, for example). This can be made precise in various ways using algebras of random variables; see e.g. this old blog post of mine on noncommutative probability.