# Intermediate value theorem problem on finding solutions to $h(x,y)=0$

Problem: Consider two continuous surjective functions $$f,g:[a,b]→[a,b]$$.If $$f(a)=f(b), g(a)=g(b),$$then find the minimum number of ordered pairs $$(x,y)$$ satisfying $$h(x,y)= 0$$ ,where $$h(x,y)=f\circ g(x)-f\circ g(y)$$; $$x,y∈[a,b]$$ and $$x≠y$$.

I thought the answer will be infinite since we're basically just counting the number of horizontal chords here and a quick sketch of $$f\circ g$$ shows that there are infinitely many such horizontal lines intersecting it at two points i.e., infinite solutions to $$h(x,y)=0$$.

But the answer is actually given as 6 with the following reasoning (open the link to get the image of the answer); So where am I going wrong?

To give a quick proof of why you are right, consider the following: the function $$f \circ g$$ has domain the same as that of $$g$$ (i.e., $$[a, b]$$), and range the same as that of $$f$$ (i.e., $$[a, b]$$) — these claims follow from the fact that $$g$$ and $$f$$ are surjective. It is continuous because it is the composition of two continuous functions, and it is surjective because it is the composition of two surjective functions. Also, $$f(g(a)) = f(g(b))$$. In other words, $$f\circ g : [a, b] \rightarrow [a, b]$$ is a continuous surjective function with the property that $$f(g(a)) = f(g(b))$$ (the same properties of $$f$$ and $$g$$ described in the problem). If you are to draw $$f \circ g$$ you can easily use your argument (that of the horizontal lines).
If you want to be completely rigorous: assume $$(f \circ g)(a)$$ is not the max of $$f \circ g$$. Let $$m \in [a, b]$$ such that $$(f\circ g)(m)$$ is the maximum of $$f \circ g$$ (there may be many $$m$$'s, take the smallest). Apply IVT to interval $$[a, m]$$ and then to interval $$[m, b]$$. That is, if $$u_1$$ is a number between $$(f\circ g)(a)$$ and $$(f\circ g)(m)$$, there is a $$c_1 \in (a, m)$$ such that $$(f\circ g)(c_1) = u_1$$. Similarly, if $$u_2$$ is a number between $$(f\circ g)(m)$$ and $$(f\circ g)(b)$$, then there is a $$c_2 \in (m, b)$$ such that $$(f\circ g)(c_2) = u_2$$. Can you see how this proves that there are infinitely many solutions? Then just do the same thing with min after assuming $$(f \circ g)(a)$$ to be the max of $$f \circ g$$.
• Let be more clear: let $u \in [(f\circ g)(a), (f \circ g) (m)]$. Then by IVT there exists $c_1 \in (a, m)$ such that $(f\circ g)(c_1) = u$. But $(f\circ g)(a) = (f\circ g)(b)$, so $[(f\circ g)(a), (f \circ g) (m)] = [(f\circ g)(b), (f \circ g)(m)]$, so $u \in [(f\circ g)(b), (f \circ g)(m)]$ and by IVT there exists some $c_2 \in (m, b)$ such that $(f\circ g)(c_2) = u$. So $(c_1, c_2)$ is a solution. The thing to point out is that this is true for all values in the interval $[(f\circ g)(a), (f \circ g) (m)]$, so for a different $u'$ will you get different $(c_1', c_2')$. Commented Dec 20, 2023 at 18:19