# When can composition of functions break?

Are there circumstances which may arise within, say, functional analysis where one's able to evaluate a composition of functions by only first evaluating the functions under composition obtaining real numbers and then, only after, map these real numbers to another real number by means of a third function? Which is to say a circumstance where evaluating a composition of functions as an aggregate produces different answers than when that same composition is evaluated in parts first, and then the result of those parts are mapped as if by composition by another function?

Is it ever the case that given:

$f(x)=x' : x\mapsto x', \text{ }${ $x \land x' \in \mathbb{R}$ }

And:

$g(x)=x'' : x\mapsto x'', \text{ }${ $x \land x'' \in \mathbb{R}$ }

With:

$h(y)=y' : y\mapsto y', \text{ }${ $y \land y' \in \mathbb{R}$ }

One is able to evaluate:

$h(x' + x'')=y'' : (x' + x'')\mapsto y'', \text{ }${ $y'' \in \mathbb{R}$ }

But for some (whatever) reason, is unable to evaluate:

$h(f(x) + g(x))=y'' : (f(x)+g(x)) \mapsto y'', \text{ }${ $y'' \in \mathbb{R}$ }

Or put another way, a situation arising wherein (given the above definitions):

$h(f(x) + g(x)) \ne h(x' + x'')$

Another possibility?

I think what may happen however (and this is my fault for not suggesting this in the OP) is that one's able to simplify the expression when in the function form like: $h(f(x)+g(x)) \mapsto s(x)$ where $s(x)$ is a simplified (reduced) form of the composition of functions $h(f(x)+g(x))$. It's this simplification step (which is only 'available' when the function is written out as a composition of functions) which must be 'throwing away information' by, say, taking a preferred branch-cut which isn't taken when the functions $f(x)$ and $g(x)$ are evaluated first to get the real numbers $x'$ and $x''$ which are then evaluated as $h(x' + x'') = y''$ though $s(x) \ne y''$.

The existence of different branch-cuts (or other such things) would change the way 'composition of functions' work, given that then these 'functions' are not one-to-one (e.g. single valued) and thereby not functions (which goes to your point @5xum)...

I'm still curious if this can occur, where a reduced (or simplified) function gives a different answer than when it is written out in full supposing we're only dealing with algebraic manipulations to put our composition of functions into a simplified form?

• No, because $h(x' + x'')$ is an ill-defined concept. The function $f$ you defined does not know that you call its output $x'$. The functions are objects that are independent of the names you give to their inputs and outputs. Thus, your expression $h(x'+x'')$ is not defined, while the expression $h(f(x)+g(x))$ is well defined, so you can't really compare the two.
– 5xum
Jun 8 '16 at 12:03

$h(x' + x'')$ is an ill-defined concept. The function $f$ you defined does not know that you call its output $x'$. The functions are objects that are independent of the names you give to their inputs and outputs. Thus, your expression $h(x'+x'')$ is not defined, while the expression $h(f(x)+g(x))$ is well defined, so you can't really compare the two.
What you have are three objects. $h$ is a function that takes some real number, and maps it to some other real number. So long as there is, for each number, exactly one number to which you map, then $h$ is a function.
Notice, I haven't used any variable names here. However, when defining functions, we usually want to introduce a free variable to explain what $h$ is doing, so we usually say, for example, $h(x)=x^2$. However we could also say that $h(y) = y^2$, and we would define the exact same function as before. However, the expression on the right of the equals sign must be an expression that gives one and only one answer to each value in the parentheses on the left side. So, if I say $h(x)=x^2$, I have defined a function because if I am given some $x$, I can calculate what $h(x)$ is.
What you did was you said that $h:y\mapsto y'$, which, without further definitions, doesn't really tell you anything except that $h$ is a function. Now, if you define $y'$ to equal $h(y)$, that's perfectly fine, but then if you also define $x'$ to be equal to $f(x)$ and $x''$ to be equal to $g(x)$, then the question
Is $h(f(x)+g(x))=h(x'+x'')$