I am looking for a function that may take any real-valued input in its domain. The image of this function should preferably be only real-valued and should have no imaginary components. The function takes the general form of: $$\lim_{x \to 0} f(x) =a:a>b \space \space\space\space \text{and}\space\space\space \space \lim_{x \to \pm\infty} f(x) =b $$ Without loss of generality, a specific example may take the form of, say: $$\lim_{x \to 0} f(x) = 1 \space \space\space\space \text{and}\space\space\space \space \lim_{x \to \pm\infty} f(x) =-1 $$ To wit, the function should asymptote symmetrically about the origin to some real-valued $b$. The value of $b$ can be arbitrary, so long as it is not the same value that $a$ is at the origin.
A function that bears some similarity to my desired function would be: $$ \frac{-2x(3x+2)}{(3x+1)^2}$$ Unfortunately, this function seems to diverge to $\infty$ near the center, and is also not centered at the origin. Another function that I have looked at is the hyperbolic tangent. Unfortunately of course, $$\lim_{x \to \infty} \tanh{x} \neq \lim_{x \to -\infty} \tanh{x}$$ There seem to be a rather large amount of functions out there that I could see potentially fulfilling the criteria, including trigonometric or power function manipulations. As a result, I'm finding it hard to narrow the search to something that manages to work for this criteria. Any help is massively appreciated.
$$f(x)=\frac{a-b}{x^2+1}+b$$ should do the job for any real $a>b$.
An alternative could be $$f(x)=(a-b)e^{-x^2}+b.$$