I am trying to have big picture intuition and linking the concepts in Generalized function (distribution) , measure theory and probability theory. So wondered if the following reasoning and linkage is a correct one and if I miss any points plus what else could be added into this picture as related concepts.
My goal is to try to look at what we call random variable (which is a function basically)
we define a distribution (generalized function) as a linear functional on the space of test functions. I deduced it as shifted point of view of what a functions is, compared to what conventionally (mainly in calculus ) we learnt about functions. In calculus, loosely speaking , we looked at the functions like something that we give a value to it , $x$, and it assigns the value , $f(x)$, to the point $x$.
Here, we look at the function as some thing that we integrate it over another object. i.e. $\int_{\mathbb{R}}f \psi$
To elaborate what I meant; here function $f$ is determined by the quantities $\int_{\mathbb{R}}f \psi$ , where $\psi$ ranges over a class of test functions.
That is, whenever we have $f$ its quantities determined whenever we integrated over $\psi$s it "always" gives us the same quantity for all $\psi$. So a function need not necessarily be defined by how it acts on points, but may instead be defined by how it acts on other objects, such as test functions or sets(?).
This way of looking at the function gives the rise to consider two functions , say $f$ ,$g$ the same that whenever they are integrated over the same $\psi$ they give the same value for the integral. Although, they may not coincide on every single points.
Incorporating the integral and my last sentence, brings me into the measure theory to link them.
We can define a finite Borel measure $\mu$ (which a distribution or generalized function) as a continuous linear functional $f \to <f,\mu>$ on the space of continuous functions using the Riesz representation theorem. So we considered the space of continuous functions as our class of test functions and trying to see what are the quantities (here measure) the function $\mu$ has over the points $f$ in this class.
If we consider $\mu$ to be a probability (generalized) function, then we have defined what is called probability distribution or probability measure. which is a function but in this weaker sense not in the sense of what we learnt in calculus.
(Is the last paragraph a correct linkage?) How can I incorporate random variable into this ?
Distributions, as you said, can be seen as a generalisation of functions where you consider how such an object "pairs up" against a smooth compactly supported function. I'd also remark that locally integrable functions and complex Radon measures can be seen as distributions. For the former ones, notice that: $$ T_g(f) := \int_{\mathbb{R}^n} f(x) \overline{g(x)} dx $$ that is, we integrate against test functions $f$. The latter case is shown similarly, using Riesz Representation Theorem.