a simple observation shows that $\displaystyle \sum_{k=1}^n \frac{g(k)}{k} = \sum_{k=1}^m \frac{1}{2^{k-1}} \left \lfloor \frac{n+2^{k-1}}{2^k} \right \rfloor,$ where $\displaystyle m=\lfloor \log_2 n \rfloor + 1.$ the value of $\displaystyle m$ is not important. what we need is to see that $\displaystyle m \rightarrow \infty$ as $\displaystyle n \rightarrow \infty.$

now since $\displaystyle x-1 < \lfloor x \rfloor \leq x,$ the squeeze theorem gives us: $\displaystyle \lim_{n\to\infty} \frac{1}{n} \sum_{k=1}^n \frac{g(k)}{k}=\frac{2}{3}. \ \ \Box$

the second problem is left for other members to try!