COMPOSITION OF FUNCTIONS

We prove that if f and g are functions from the reals into the reals such that the composition of g with f is continuous and f is both Darboux and surjective, then g is continuous. We also prove that continuous and Darboux can be interchanged in the above statement.


What This Looks Like
A composite function can be represented by a table, by graphs, or by an equation.

Tables
Consider the functions represented by the following tables.
• Find the value of the inner function for the x value you just found. In this case, that means find the value that g takes when x = 1. That's 2.
• Find the value of the outer function for the x value you need. In this case, that means find the value that f takes when x = 2. That value is 4.

Graphs
You can take the same steps working from graphs: To take the example of (f • g)(2) again (still for the functions f (x) = x 2 and g(x) = x + 1), use a graph of g(x) to find the value of g(2) and then use a graph of f (x) to find the value of f for g(2). The graphs look like this: As you can see from the graph of g(x), g(1) = 2. Next, look at the graph of f (x) and see that f (2) = 4. So (f • g)(1) = 4.

For a specific number
Sticking with our example, let's say f (x) = x 2 , g(x) = x + 1, and you want to use equations to find f (g(1)). To do that, find g(1) and find f of that result.
It amounts to a double plug-in.
If you want to apply the same two functions in the same sequence over and over, it can get pretty tedious. That's when you may want to combine the two functions into one composite function.

One equation to represent two functions composed
Let's try the same example but this time with variables. h(x) = (f • g)(x) is a function that adds 1 to a variable and then squares the result: h(x) = (x + 1) 2 . Let's see if we get the same result as we did above for h(1) : h(1) = (1 + 1) 2 = 4. Check.
Try another one: To do this, you need to insert k(x) into places in j(x) where you see x. Now, when the functions are complex and there are x's all over the place, that is a much harder thing to do than it was when the functions were simple. What makes it especially confusing, I think, is that what is meant by One way to avoid this potential confusion is to break the process into steps, as follows: In other words, in j(k(x)), k(x) takes the role that x takes in j(x). Simplify.

Domain
One piece of information may be lost when functions are composed: domain constraints. In the first example, with a linear function composed with a parabola, the domain of both original functions is all real numbers -as is the domain of the composite function. In the second example, in which two rational functions are composed, what happens?
x+2 , x = −2, because a value of x = −2 would make the denominator equal 0; similarly, for the inner function, k(x) = x+3 x−2 . x = 2. How do those constraints translate into domain constraints for the composite function (j • k)(x) = −3x+11 3x−1 ? Note that the denominator of the original inner function, x − 2, doesn't show up in the final composite function. Does that mean that 2 is included in the composite function's domain? Remember that the first step in finding (j • k)(x) is to find k(x). You can't do that for an x value for which the denominator equals zero. So a constraint on the inner function of a composite function is a constraint on the composite function. Such a constraint is not obvious when you look at the composite function alone; you know it only if you know the original inner function or if it is stated explicitly.
What about the outer function? Again in the second example, (the j, k example), the constraint is that the denominator, x + 2, cannot equal 0. But what is x? In this context, x is function k of the inner function. So the constraint is that k(x) + 2 = 0. Solve.
The denominator, 3 · 1/3 − 1, is equal to 0, so indeed the function is undefined at that point and 1/3 is excluded from the domain. A domain constraint created by the outer function shows up in the composite function. You don't have to go back to the original outer function to find it; if there is one, you can see it in the composite function.

Example: composing two functions in various ways
For the functions f (x) = x 2 − 4 and g( , and state the domain of each composite function. Solution: Start with f (g(x)) f (g(x)) = (g(x)) 2 − 4 Carry out function f on g(x) f (g(x)) = ( √ x + 1) 2 − 4 Substitute in the definition of g(x). f (g(x)) = x − 3 Simplify.
Domain constraints: Look for domain constraints in both the original inner function and the composite function. In the inner function, g(x), because there is an assumption that solutions are real, the argument of the square root function must be greater than or equal to 0, so x ≥ −1. In the composite, since the domain of the function y = x − 3 is all real numbers, there is no additional domain constraint.

So the domain of the composite function is [−1, ∞).
Next look at g(f (x)).
The inner function, f (x) = x 2 − 4, has no domain constraint and does not create a hidden domain constraint in the composite function. The composite function, g(f (x)) = √ x 2 − 3, has the constraint that the expression under the radical sign must be greater than or equal to 0.
So the domain of the composite function g(f (x)) = √ .
(Remember that (f • f )(x) is just another notation for f (f (x)).) Yes, you can compose a function with itself. Why not.
The inner function, f (x) = x 2 − 4, has no domain constraint. Nor does the composite function, y = x 4 − 8x 2 + 12, have a domain constraint. So the domain is all real numbers.
Carry out function g on g(x).
In the inner function, g(x) = √ x + 1, x + 1 must be greater than or equal to 0, so there is the domain constraint that x ≥ −1. In the composite function, y = √ x + 1 + 1, √ x + 1 + 1 must be greater than or equal to 0 for the function to be real. Since a square root is by definition nonnegative, √ x + 1 is greater than or equal to 0 for all values of x for which it is defined (i.e., x ≥ −1, so √ x + 1 + 1 is always at least 1 and therefore in no danger of being negative).
So the domain of (g • g)(x) is [−1, ∞). Applications: An understanding of composition of functions will help you learn about inverse functions.