Well, the easy part is that a composition fog would be a mapping from A to C. So the real question here is to determine that fog is well-defined. To do this, we have to show that if a = b, then fog(a) = fog(b).
So, suppose f: A to B and g: B to C are functions. Let a = b be elements of A. Then, since f is a function, and is therefore well-defined, f(a) = f(b). These are elements of B. Since g is a well-defined function from B, g(f(a)) = g(f(b)), elements of C. Hence, fog(a) = fog(b). Therefore, fog is well-defined, and hence, is a function mapping from A to C.