Let $\Psi$ be a bump function such as the one described here: http://en.wikipedia.org/wiki/Bump_function#Examples
Let $f(x)=ub+(1-u)x$, where $u=\Psi(|x-a|^2)/\Psi(0)$.
[EDIT] Bernard has a good point, which is that it's not obvious that $f^{-1}$ is smooth. In fact, I think the real issue is whether or not $f$ is invertible. So here's a patched-up version of the above map.
$u=\Psi(k|x-a|^2)/\Psi(0)$
$k=(b-a)^{-2}/1000$
$f(x)=(x+b-a)u+x(1-u)$
The specific bump function $\Psi(z)$ given in the WP article is clearly smooth, and has a smooth inverse, everywhere except possibly at $z=0$ and $z\ge 1$. The factor of $1/1000$ ensures that $f$ is always invertible, since $\Psi$ never has a slope as large as 1000. I don't think we have an issue at $z=0$, since the constancy of $\Psi$ there just means that $f$ looks like an identity map at $a$. Ditto at $z\ge1$.