According to Wiki:
Consider a nonempty set $X$ and a $ \sigma$-algebra $ F$ on $ X$, then the tuple $(X,A)$ is called a measurable space.
Also according to Wiki:
A random variable $X$ is a measurable function from a sample space to a measurable space.
There are so many things that confuse me here. In the first definition measurable space is defined as a tuple, so X can't be a function because it is a mapping of a set to a tuple ( a function is defined as a mapping between 2 sets).
On the other hand, also according to Wiki:
A measurable function is mapping between 2 measurable spaces, such that...
So the random variable X can't be a measurable function, because its domain is the sample space of a measurable space, not the measurable space itself ! And if the measurable space is a tuple, a measurable function can't be a function anyway.
Did Wikipedia confuse the measurable space with the sample space?