The probability mass function of the Binomial distribution is given by
$$\begin{equation} f(x)=\binom{n}{x} p^x (1-p)^{n-x}, \end{equation}$$ where $p \in [0,1]$ and $x=\{0,1,\dots,n\}$ (finite support).
The Mellin transform of $f$ is therefore $$\begin{align} \mathcal{M}\{f\}(s)&=\int_0^{\infty}x^{s-1} \binom{n}{x} p^x (1-p)^{n-x}\mathrm{d}x\\ &=\sum_{k=0}^{n}k^{s-1} \binom{n}{k} p^k (1-p)^{n-k}. \end{align}$$ Since $f$ is a probability mass function, the integral becomes a sum. Now I'd like to apply the inverse Mellin transform to get back $f$: $$\begin{align} \mathcal{M}^{-1}\{\mathcal{M}\{f\}\}(x) &= \frac{1}{2 \pi i} \int_{c-i\infty}^{c+i\infty} x^{-s} \left( \sum_{k=0}^{n}k^{s-1} \binom{n}{k} p^k (1-p)^{n-k} \right) \mathrm{d}s \\ &=\frac{1}{2 \pi i} \sum_{k=0}^{n} \binom{n}{k} p^k (1-p)^{n-k} \int_{c-i\infty}^{c+i\infty} x^{-s} k^{s-1} \mathrm{d}s. \end{align}$$
The problem is that the integral $\int_{c-i\infty}^{c+i\infty} x^{-s} k^{s-1} \mathrm{d}s$ doesn't seem to converge. Essentially it's equal to $$ \begin{align} \int_{c-i \infty}^{c+i\infty} x^{-s}k^{s-1} \mathrm{d} s &= \frac{1}{x} \int_{c-i \infty}^{c+i\infty} \left(\frac{k}{x}\right)^{s-1} \mathrm{d}s\\ &=\frac{i}{x} \int_{-\infty}^{\infty} e^{it \ln \left({\frac{k}{x}} \right)} \mathrm{d}t. \end{align} $$ So the integrand is forever oscillatory, and doesn't seem to have a value. I did read that it "equals" the dirac Delta distribution, but I'm not sure how it'll fit in with the other terms since that's not really a function. But at the same time, since $f$ has support on a finite set, it kind of makes sense for it to show up?
I'm pretty lost, how can I recover $f$?
Thanks to Steven Clark for some clarification. Indeed the dirac-Delta is very relevant here, I should've played around with it more.
What happens is that \begin{align} \int_{c-i \infty}^{c+i\infty} x^{-s}k^{s-1} \mathrm{d} s &= \frac{1}{x} \int_{c-i \infty}^{c+i\infty} \left(\frac{k}{x}\right)^{s-1} \mathrm{d}s,\\ &=\frac{i}{x} \int_{-\infty}^{\infty} e^{it \ln \left({\frac{k}{x}} \right)} \mathrm{d}t,\\ &= \frac{2 \pi i}{x} \delta\left(\ln\left(\frac{k}{x}\right)\right),\\ &= 2 \pi i \delta \left(k-x\right). \end{align}
and what I completely missed is that $\mathcal{M}^{-1}\{\mathcal{M}\{f\}\}(x)$ is a function of $x$ on the real number line, and that $\delta\left(\ln\left(\frac{k}{x}\right)\right) = x \delta \left(k-x\right)$, which not only cancels the $x$ in the denominator that I could not get rid of, but also means that the integral is 0 whenever $x \neq k$. So we get that \begin{align} \mathcal{M}^{-1}\{\mathcal{M}\{f\}\}(x) &=\frac{1}{2 \pi i} \sum_{k=0}^{n} \binom{n}{k} p^k (1-p)^{n-k} \int_{c-i\infty}^{c+i\infty} x^{-s} k^{s-1} \mathrm{d}s,\\ &=\frac{1}{x}\sum_{k=0}^{n} \binom{n}{k} p^k (1-p)^{n-k} \delta\left(\ln\left(\frac{k}{x}\right)\right),\\ &=\sum_{k=0}^{n} \binom{n}{k} p^k (1-p)^{n-k} \delta\left(k-x\right),\\ &=f(x). \end{align} Very cleverly, all the terms inside the sum equal zero except for when $x=k$, which is where the dirac-Delta spikes. This is exactly the behavior $f$ (and probability mass functions in general) would exhibit had it been defined on the entire real number line!
It also does integrate to 1 along $\mathbb{R}$, and the antiderative $\int_{-\infty}^x f(t) \mathrm{d}t$ is a step function that changes in value at each $x=\{0,1,\dots,n\}$ by $\binom{n}{x} p^x (1-p)^{n-x}$, which is indeed the binomial CDF.