How does probability density function work? 
Hello. 
I inserted an image because it's easier to understand my questions. 
I don't understand how pdf works. If I say I want te probability of X=1, it returns me 0,667. But what's that? Is it the whole area under the triangle of base 1 and height 0,667? So why doesn't A=b*h/2 equal to 0,667? A=2/6=1/3 ;
Also, if I do the integral of the function (2/3)*x shouldn't it give me the same result as f(1) = 2/3 ? Since the fdp says that the area below the graph is the probability of X=k.. 
Lets say my random variable is the kilograms of rice that people buy in a store. The probability o X=1 kilogram is zero, because the area under the graph is zero.  So it makes more sense to say we want P(0
 A: For a "continuous" (non-discrete) random variable the probability for any individual outcome is zero. The pdf does not represent probabilities, it is a non-negative function that integrates to $1$ in it domain, that is
$$\int_{-\infty}^\infty f_X(x)\mathrm dx=1$$
For a continuous random variable their probabilities are determined by areas under it pdf... by example
$$\Pr[0\le X\le 1]=\int_0^1f_X(x)\mathrm dx =\frac{x^2}3\bigg|_0^1=\frac13$$
or
$$\Pr[X\ge 1/2]=\int_{1/2}^\infty f(x)\mathrm dx=\int_{1/2}^1\frac{2x}3\mathrm dx+\int_1^3\left(1-\frac{x}3\right)\mathrm dx=\frac{x^2}3\bigg|_{1/2}^1+\left(x-\frac{x^2}6\right)\bigg|_1^3=\\=\frac13-\frac1{12}+\left(3-\frac32\right)-\left(1-\frac16\right)=\frac3{12}+\frac32-\frac56=\frac{11}{12}$$
obviously we have that $\Pr[X\le1/2]=1/12$. In the same way for any individual $x=a$ we have that
$$\Pr[X=a]=\int_a^a f_X(x)\mathrm dx=0$$
A: In this example, you can think of the area under the PDF between two limits (say, between $1$ and $3$) as the probability that the random variable falls between those two limits.  Here, a triangle of base $2$ and height $\frac23$ yields an area, and thus a probability, of $\frac23$.
More generally, the height of the PDF represents a kind of probability rate: the variable falls within an infinitesimal range around $1$ of width $dx$ with an infinitesimal probability of $\frac23 dx$.  Around $2$, where the height of the PDF is $\frac13$, the rate is $\frac13 dx$ per $dx$ width of interval.  And so on.  That is why the integral of the PDF produces a probability.  Note that this means the integral (and therefore the area) over the entire domain of the random variable must be $1$—the probabilities of all possibilities add up to $1$, in other words.
A: The probability that the random variable is between two numbers on the $x$-axis is the area under the graph of the density function above the part of the $x$-axis that is between those numbers. For example, look at the part of the graph between $x=2$ and $x=3.$ The area under the graph between those points is a triangle whose base has length $1$ and whose height is $1/3$, so whose area is $1/6.$ Thus the probability that the random variable is between $2$ and $3$ is $1/6.$
