Let $M,N$ be two metric spaces and $f,g:M\rightarrow N$ continuous functions. Show that the set $A=\{x\in M|\space f(x)\neq g(x)\}$ is open in $M$.
Well, I understand that if $h(x)=d_{N}(f(x),g(x))$ it is only left to prove, that $h$ is continuous and then the set $A=\{x\in M|\space h(x)>0\}$ is open. My question is, what was the 'mind process' to get to the conclusion that I should use $h$ instead of something else to prove that proposition. What was the intuition behind creating that function.
I hope you guys understand what Im trying to ask, thanks so much in advance.