Show that the set of 2 continuous functions is closed. 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. 

How much do you know about continuous functions? For example, do you know that for a continuous function $h$ and a closed set $X$, the set $h^{-1}(X)$ is always closed?

If you know that, the continuation is badly written, but captures the idea. First, you define the function $h = f-g$. Then, you can see that $$E=\{x\in \mathbb R: f(x) = g(x)\} = \{x\in\mathbb R: f(x)-g(x)=0\} = \{x\in\mathbb R: h(x) = 0\} = h^{-1}(\{0\})$$
This means that $E$ is the preimage of $\{0\}$ for the function $h$, and, since $h$ is continuous and $\{0\}$ is a closed set, $E$ is a closed set.
