For (a) take g(x)= x and f(x)= 1/x, a= 0. \(\displaystyle \lim_{x\to 0} g(x)= \lim_{x\to 0} x= 0\) and \(\displaystyle \lim_{x= 0} g(x)f(x)= \lim_{x\to 0} 1= 1\) but \(\displaystyle \lim_{x\to 0} f(x)\) does not exist.
For (b) reverse those, taking g(x)= 1/x, f(x)= x. Then \(\displaystyle \lim_{x\to 0} f(x)= 0\), \(\displaystyle \lim_{x\to 0} \frac{f(x)}{g(x)}= \lim_{x\to 0} x^2= 0\) but \(\displaystyle \lim_{x\to 0} g(x)\) does not exist.
(It is not a question of the functions "existing or not existing" but the limits.)