Let $f(x)=(x-a)g(x)$. Calculate $f '(a)= g(a)$. Assuming that $g$ is continuos. What is $f(a)$ in this case? Can you give an explanation for this proof? How can it be possible to ask about a function of another variable of an existing function? Can you give other examples? This made me question my understanding of functions.

you have  $f(a) = 0,$ and from the definition of the derivative $$f'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x-a} = \lim_{x \to a} g(x) = g(a)  .$$ in the last step the continuity of $g$ at $x = a$ is used.
