How to prove that this function is continuous at zero? Assume that $g : [0, \infty) \rightarrow \mathbb R$ is continuous  and $\phi :\mathbb R \rightarrow \mathbb R$  is continuous with compact support with $0\leq \phi(x) \leq 1$, $\phi(x)=1$ for $ x \in [0,1]$ and $\phi(x)=0$ for $x\geq 2$. 
I wish to prove that
$$
\lim_{x \rightarrow 0^-} \sum_{n=1}^\infty \frac{1}{2^n} \phi(-nx) g(-nx)=g(0).
$$
I try in the following way.
Let $f(x)=\sum_{n=1}^\infty \frac{1}{2^n} \phi(-nx) g(-nx)$ for $x \leq 0$.
For $\varepsilon>0$ there exists $n_0 \in \mathbb N$ such that $\sum_{n\geq n_0} \frac{1}{2^n} \leq \frac{\varepsilon}{2|g(0)|}$.
For $x<0$ there exists $m(x) \in \mathbb N$, $m(x)> n_0$ such that $\phi(-nx)=0$ for $n>m(x)$. 
Then 
$$
|f(x)-f(0)|\leq \sum_{n=1}^\infty \frac{1}{2^n} |\phi(-nx)g(-nx)-\phi(0)g(0|=
\sum_{n=1}^{m(x)} +\sum_{n\geq m(x)}
$$
(because $\phi(0)=1$, $\sum_{n=1}^\infty \frac{1}{2^n}=1$).
The second term is majorized by $\frac{\varepsilon}{2}$ , but I don't know what to do with the first one 
because $m(x)$ depend on $x$.

Let $h(x)=\phi(x)g(x)$. Then $h\colon[0,\infty)\to\mathbb R$ is continuous and bounded by some $M$ and $h(x)=0$ for $x\ge2$.
Given $\epsilon>0$, find $\delta$ such that $x<\delta$ implies $|h(x)-h(0)|<\frac\epsilon3$.
Then for $m\in \mathbb N$
$$\sum_{n=1}^\infty \frac1{2^n} h(nx)-h(0)=\sum_{n=1}^{m} \frac1{2^n} (h(nx)-h(0))+\sum_{n=m+1}^\infty \frac1{2^n} h(nx)-\frac1{2^m}h(0)$$
If $m<\frac\delta x$, then 
$$\left |\sum_{n=1}^{m} \frac1{2^n} (h(nx)-h(0))\right |<\sum_{n=1}^\infty \frac 1{2^n}\frac\epsilon3=\frac\epsilon3.$$
For the middle part, $$\left|\sum_{n=m+1}^\infty \frac1{2^n} h(nx)\right|<\frac M{2^m}$$
and finally $\left|\frac1{2^m}h(0)\right|\le \frac M{2^m}$.
If $m>\log_2(\frac {3M}\epsilon)$, we find that 
$$\left|\sum_{n=1}^\infty \frac1{2^n} h(nx)-h(0)\right|<\epsilon$$
for all $x$ with $x<\min\{\delta,\frac Mm\}$.
