  In this paper we study the following singular perturbation problem for the
$p_\varepsilon(x)$-Laplacian: \[
\Delta_{p_\varepsilon(x)}u^\varepsilon:=\mbox{div}(|\nabla
u^\varepsilon(x)|^{p_\varepsilon(x)-2}\nabla
u^\varepsilon)={\beta}_{\varepsilon}(u^\varepsilon)+f_\varepsilon, \quad
u^\varepsilon\geq 0, \]
  where $\varepsilon>0$, ${\beta}_{\varepsilon}(s)={1 \over \varepsilon}
\beta({s \over \varepsilon})$, with $\beta$ a Lipschitz function satisfying
$\beta>0$ in $(0,1)$, $\beta\equiv 0$ outside $(0,1)$ and $\int \beta(s)\,
ds=M$. The functions $u^\varepsilon$, $f_\varepsilon$ and $p_\varepsilon$ are
uniformly bounded. We prove uniform Lipschitz regularity, we pass to the limit
$(\varepsilon\to 0)$ and we show that, under suitable assumptions, limit
functions are weak solutions to the free boundary problem: $u\ge0$ and \[
\begin{cases} \Delta_{p(x)}u= f & \mbox{in }\{u>0\}\\ u=0,\ |\nabla u| =
\lambda^*(x) & \mbox{on }\partial\{u>0\} \end{cases} \] with
$\lambda^*(x)=\Big(\frac{p(x)}{p(x)-1}\,M\Big)^{1/p(x)}$, $p=\lim
p_\varepsilon$ and $f=\lim f_\varepsilon$.
  In \cite{LW4} we prove that the free boundary of a weak solution is a
$C^{1,\alpha}$ surface near flat free boundary points. This result applies, in
particular, to the limit functions studied in this paper.
