Calculating f(x) for an i.i.d. We know that for a gaussian distribution,
$f(x) = 1/\sqrt{2\pi\sigma^2} \exp[ -(x-\mu)^2/2\sigma^2 ]$
I was wondering that given an i.i.d. random variable with a given distribution, whether there exists some function $f(x)$.
For e.g: Let us say, $X$ is a random variable whose values are $X = {-3,-2,-1,0,1,2,3}$ with Probabilities $P{X} = \{0.1, 0.1, 0.2, 0.2, 0.2, 0.1 ,0.1\} $respectively. Its mean is $0$, and variance is $3$. Can we now find an equation for $f(x)$ like we found one for the gaussian distribution?
 A: The function you describe is called a probability density function for a continuous random variable. The analogue for a discrete distribution is the probability mass function. This, however, is basically exactly what you have described by declaring the possible values of the random variable and their associated probabilities. 
We can, however, form a sort of pdf for the discrete random variable using the Dirac delta function. This is a "function" $\delta(x)$ which satisfies $\delta(x) = 0$ for $x\neq 0$ and 
$$\int_a^b\delta(x)dx = 1$$
if $0\in (a,b)$. Thus if we have $n$ outcomes for a discrete random variable, say $x_1,x_2,\dots,x_n$ occurring with probabilities $p_1, p_2, \dots, p_n$ respectively, then 
$$f(x) = \sum_{i=1}^np_i\delta(x-x_i)$$
Acts like the pdf that we want. That is, $\int_{-\infty}^\infty f(x)dx = 1$ [do you see why?], and $F(x) = \int_{-\infty}^x f(t)dt = P(X\le x). $
There are a few fuzzy details here, however, which is why you probably shouldn't think of a discrete random variable in this way. One is that $f(x_i)$ is not defined for one of the outcomes of the random variable. You lose the ability to work with individual points and must work with small intervals around possible outcomes. This is one of the many reasons why the current theory of probability doesn't use the Riemann integral, which is the traditional integral you learn about in introductory calculus. It allows us to use roughly the same tools to think about continuous and discrete random variables. In this framework, a probability distribution is a way of assigning probability to what are called "measurable" sets in the set of possible outcomes (usually $\Bbb{R}$ or a subset of it). If the random variable is discrete, the measurable sets are just those subsets of all possible outcomes, while for continuous random variables, the situation is more complicated but is well known to behave just like the Riemann integral in most "nice" cases. For the particular example of $x_i$ and $p_i$ described above, which is a generalization of the problem you posed, this probability distribution assigns to the set that contains $x_j$ for $j$ in some index set $J\subset\{1,2,\dots,n\}$, the probability $\sum_{j\in J}p_j$. 
