(a) There exists a finitely generated (f.g.) group that is an inductive limit of a sequence of epimorphisms of f.g. residually finite groups, and is not residually finite. The first such example is due to B.H. Neumann (1937) and I describe it below.

Write $Y=\{(i,j)\in\mathbf{Z}\times\mathbf{N}: |i|\le j\}$. View it as the disjoint union of the finite subsets $Y_j=\{(i,j): |i|\le j\}$; write $Y_{\ge m}=\bigcup_{j\le m}Y_j$. Let $W_m$ be the group of permutations of $Y_{\ge m}$ preserving each $Y_j$: it is residually finite (since it embeds in the (infinite) product of symmetric groups on the $Y_j$ for $j\ge m$ (note that $W_m$ is quotient of $W_{m-1}$ by a finite normal subgroup).

Let $c$ act on each $Y_j$, $j\ge 1$ as the transposition $0\leftrightarrow 1$. Let $t$ act on each $Y_j$ as the cycle $(-j,\dots,j)$. On $Y_j$, the images of $c$ and $t$ generate the symmetric group (on $2j+1$ letters). Then $c$ and $t$ define elements $c_m$, $t_m$ of $W_m$, acting on $Y_{\ge m}$. Define $G_m=\langle c_m,t_m\rangle\subset W_m$. Then clearly the image of $G_{m-1}$ in $W_m$ by the canonical projection ("forgetting $Y_{m-1}$") is $G_m$.

So we have epimorphisms $G_2\to G_3\to\dots$, and all are residually finite. Let $G$ be the inductive limit. The kernel of $G_2\to G_m$ is the set of elements of $G_2$ that are identity outside $\bigcup_{2\le j\le m}Y_j$. Hence the kernel of $G_2\to G$ the union of these kernels, namely the set of elements of $G_2$ with finite support (typical nontrivial such elements are $[t,c^ntc^{-n}]$ for $n\ge 2$). It is not hard to see that we can identify the quotient $G$ as the group acting on $\mathbf{Z}$ generated by the transposition $0\leftrightarrow 1$ and the shift $n\mapsto n+1$. This 2-generated group contains the group of finitely supported permutations of $\mathbf{Z}$, which is not residually finite, since it has an infinite simple subgroup of index 2 (Onofri 1929).

This example was rediscovered when the concept of LEF group was clarified (Stëpin in the early 1980s, Vershik-Gordon in the 1990s).

(b) Edit 2: Here's an additional example with an inductive limit of finitely presented groups. [Edit 3: the example in (a) might work similarly, see (c) below]

For $n\le\infty$, let $M_n$ be the infinitely generated "right-angled Artin group" $$\langle x_m,y_m:m\in\mathbf{Z}\mid [x_p,x_q],[x_p,y_q]\text{ if } 0<|p-q|<n\rangle.$$
Note that $M_\infty$ is the restricted direct product $\bigoplus_{p\in\mathbf{Z}}F(x_p,y_p)$ of the free groups on 2 generators .

Using the obvious shift automorphism $x_p\mapsto x_{p+1}$, $y_p\mapsto y_{p+1}$, define, for $n\le\infty$ the $H_n$ as the semidirect product $M_n\rtimes\mathbf{Z}$.

Then $H_n$ has the presentation
$$\langle t,x_0,y_0\mid [x_0,t^px_0t^{-p}],[x_0,t^py_0t^{-p}]:1<|p|\le n\rangle. $$

This is a finite presentation for $n<\infty$. It is not hard to check in addition that this is a residually finite group.

But $H_\infty$ is a standard wreath product $F(x_0,y_0)\wr\mathbf{Z}$, which is not residually finite by an old remark of Gruenberg (1957).

Let's go back to (a), it might works too (i.e. with f.p. residually finite approximating groups). This is mostly similar to (b).

For $n\le\infty$, define the Coxeter group
$$Q_n=\langle x_p:p\in\mathbf{Z}\mid x_p^2,(x_px_{p+1})^3\;\forall p,[x_p,x_q],\;\forall p,q\text{ s.t. }2\le |p-q|\le n\rangle.$$

Note that $Q_\infty$ can be represented as the group of finitely supported permutations of $\mathbf{Z}$, $x_i$ acting as transposition $i\leftrightarrow i+1$. Consider the automorphism $x_i\mapsto x_{i+1}$ of $Q_n$ and define $L_n=Q_n\rtimes\mathbf{Z}$. Thus $L_\infty$ is the B.H. Neumann group of (a), which can be also represented as the group of those permutations of $\mathbf{Z}$ that act as a translation outside a finite subset, generated by transposition $0\leftrightarrow 1$ and by the shift $p\mapsto p+1$.

The group $L_n$ is presented, namely as
$$L_n=\langle t,x_0\mid x_0^2,(x_0tx_0t^{-1})^3,[x_0,t^px_0t^{-p}]:2\le p\le n\rangle,$$
which for $n<\infty$ is a finite presentation. I believe it can be checked that $L_n$ is residually finite if $n<\infty$. [The easy virtual retraction argument I have in mind in (b), however, doesn't work: Coxeter groups with odd exponents are a little more complicated that those with only even/infinity exponents.]