I was wondering if somebody could check my proof for the following problem. I'm failry certain its correct (atleast correct in the general direction of the proof), I just wanted to make sure. Firstly, the proof makes use of the following theorems / properties:

Now heres the problem:

[1]

If $\displaystyle f$ is continuous on $\displaystyle [a, b]$ (i.e. $\displaystyle lim_{x \to a} f(x) = f(a)$ for all $\displaystyle x \in [a, b]$) and $\displaystyle g$ is continuous on $\displaystyle [a, b]$ then $\displaystyle f - g$ is continuous on $\displaystyle [a, b]$.

[2]

If $\displaystyle f$ is continuous on $\displaystyle [a, b]$, and $\displaystyle f(a) < 0 < f(b)$, then $\displaystyle f(x) = 0$ for some $\displaystyle x \in [a, b]$

Now heres my proof. I know this problem will probably seem trivial and super easy to allot of people, but I just wanted to make sure I'm doing it correctly:

Given that $\displaystyle f$ and $\displaystyle g$ are both continuous on $\displaystyle [a, b]$, that $\displaystyle f(a) < g(a)$, and that $\displaystyle g(b) < f(b)$; then prove that $\displaystyle f(x) = g(x)$ for some $\displaystyle x \in [a, b]$

Showing that:

$\displaystyle f(x) = g(x)$

For some $\displaystyle x \in [a, b]$ is equivelant showing that:

$\displaystyle f(x) - g(x) = 0$

For some $\displaystyle x \in [a, b]$

So, lets let:

$\displaystyle h(x) = f(x) - g(x)$

By the given information and property/theorem number [1], we know that $\displaystyle h$ is continuous on $\displaystyle [a, b]$

Now, since:

$\displaystyle f(a) < g(a)$

then:

$\displaystyle f(a) - g(a) = h(a) < 0$

And since:

$\displaystyle g(b) < f(b)$

then:

$\displaystyle 0 < h(b) = f(b) - g(b)$

So we have:

$\displaystyle f(a) - g(a) < 0 < f(b) - g(b)$

Equivilantly...

$\displaystyle h(a) < 0 < h(b)$

Since we also know that $\displaystyle h$ is continuous on $\displaystyle [a, b]$, then by property/theorem [2] we are garunteed that:

$\displaystyle h(x) = 0$

For some $\displaystyle x \in [a, b]$

Thus:

$\displaystyle f(x) - g(x) = 0$

For some $\displaystyle x \in [a, b]$

Therefore we've shown we must have:

$\displaystyle f(x) = g(x)$

For some $\displaystyle x \in [a, b]$