Let $f: \mathbb R \to \mathbb R $ and $g: \mathbb R \to \mathbb R$ be continuous functions. Show the set $ E = \{ x \in\mathbb R: f(x)=g(x)\} $ is closed.
My approach
A solution I found is the following:
$h=f-g$
$h(x)=f(x)-g(x)=0$
f and g are continious and h is continious
Taking $h(E)=\{ x\in \mathbb R:h(x)=0\}$ // makes no sense, why $x\in\mathbb R$ and not $h(x)\in\mathbb R$
$h^{-1} (E)=\{0\}$ is closed // why is the inverse only zero?
=> $E$ is closed
Is the solution correct? Seems very elegant and short, but $h(E)$ makes no sense to me please explain.