Let $f, g\colon \Bbb R\to\Bbb R$ be functions. Let $A:=\{x\in\Bbb R\colon f(x)\neq 0\}$ and $B:=\{x\in\Bbb R\colon g(x)\neq 0\}$ such that $A\cap B=\emptyset.$Now, define $h\colon\Bbb R\to\Bbb R$ by $h(x)=f(x)+g(x).$ Notice that $h$ is well defined.
$h^{-1}(r)=f^{-1}(r)\cup g^{-1}(r)$ for all $r\in\Bbb R\setminus\{0\}.$
To see this, for $0\neq r\in\Bbb R$. let $x\in h^{-1}(r)$ and this means $h(x)=r$ and so $f(x)+g(x)=r.$ Since $A\cap B=\emptyset$ and $0\neq r.$ So, we can assume $f(x)=r$. Then, $x\in f^{-1}(r)\cup g^{-1}(r).$ On another hand, let $x\in f^{-1}(r)\cup g^{-1}(r)$ and this clearly gives $x\in h^{-1}(r).$
Is that right?
Proof:
If $\,x\in h^{-1}(0)\,,\;$ then $\,h(x)=0\,,\,$ hence $\,f(x)+g(x)=0\,.$
Consequently there exists $\,r\in\mathbb R\,$ such that $\,f(x)=r\;\land\;g(x)=-r\;.$
$r\;$ has to be equal to $\,0\,,\,$ otherwise $\;x\in A\cap B=\emptyset\,$ which is a contradiction.
Hence, $\,f(x)=g(x)=0\,$ that is $\,x\in f^{-1}(0)\cap g^{-1}(0)\,.$
On the other hand, if $\,x\in f^{-1}(0)\cap g^{-1}(0)\,,\,$ then $\,f(x)=g(x)=0\,,\,$ consequently $\,h(x)=0\,,\,$ hence $\,x\in h^{-1}(0)\,.$