I have to find $\cal{M}(f)$ where $f(x)=x,\ 0<x<a$ and zero otherwise. Thus, we can write $f(x)=xH(a-x)$ where $H(x)$ is the unit Heaviside function. Then I obtained $$ {\cal M}(f)(s)=F(s)=\int_0^a x^s \,\mathrm dx=\frac{a^{s+1}}{s+1}, $$ for $s>-1$. I decided to check the result by finding the inverse transform $$ {\cal M}^{-1}(F)(x)=\frac1{2\pi i}\int_{c-i\infty}^{c+i\infty} \frac{a^{s+1}x^{-s}}{s+1}ds=x.\tag{1} $$ The above result obtained using pole $s=-1$. Thus, instead of $f(x)=xH(a-x)$ I obtained just $x$.
Why is the result different?
You have $$\frac{a}{2\pi i}\int\limits_{c-i\infty }^{c+i\infty }{\frac{1}{s+1}{{\left( \frac{a}{x} \right)}^{s}}ds}=\frac{a}{2\pi i}\int\limits_{c-i\infty }^{c+i\infty }{\frac{{{e}^{s\log \left( a/x \right)}}}{s+1}ds}$$ Where $c\gt-1$. Now consider a semi-circular contour of radius $R>0$ joining the vertical line, closing it in a loop. We have $s=R\cos \left( \theta \right)+iR\sin \left( \theta \right)$ in the exponential. A circle in the RHP will mean $\cos \left( \theta \right)\ge 0$ while one in the LHP yields $\cos \left( \theta \right)\le 0$. We want the integral to go to zero on this contour as $R$ becomes infinite and so we need a negative argument against $R$ in the exponential. So for $0<a/x<1$ we close to the right, and so we don’t pick up the residue. While for $a/x>1$ we close to the left and since $c>-1$ we pick up the residue. Hence we retrieve your step function.