How I can get a quantile function of a discrete distribution, like the binomial distribution I know it's easy to get a quantile function of a continuous function, but how can I get a quantile function of a discrete distribution, like the binomial distribution?
 A: Let's say that $X$ takes values in the set $\{0,1,2\}$ with probabilities $\{\frac12,\frac14,\frac14 \}$.
Now, let $a\in [0,2]$. What is $P(X\leq a)$?
I'll give a couple example calculations. Then you can try to see how it will generalize.
Let $a=0$, then $P(X\leq 0)=\frac12$, so the quantile function would need to assign the quantile value $0$ to any percentage point in $[0,\frac12)$. At exactly $\frac12$ there will be range of equally acceptable quantiles: $[0,1)$
Now, let $a=1.3$, then $P(X\leq 1.3)=P(X=0)+P(X=1)=\frac34$. This will be true for any $1 \leq a<2$. At the percentage point $\frac34$, the quantile can be represented by any value in $[1,2)$. For percentages in $(\frac12,\frac34)$ the unique quantile will be $1$. 
Do you see the pattern, can you see how this would generalize to more realistic distributions like the Binomial? The step-function behavior means that there will be a range of values in $\mathbb{R}$ that have equal claim to being a given quantile. This ambiguity disappears if we restrict the quantiles to the range of $X$.
