Our goal is to find f(3). Since f(x) is continuous we know that and thus finding f(3) amounts to finding the limit.
Using the limit laws we have
Using that both functions x and g(x) are continuous, we have that
and
Plugin this into the above equality, we find
and hence
By the first remark above we have