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.
This proof is what is often called a follow your nose proof --- at each step you do the only thing that you can with the given information, and you end up at the result. For this problem, it goes as follows: