\(h\left(x\right)=x^2-4x+5+m\)
\(g\left(x\right)=\left|h\left(x\right)\right|=\left|f\left(x\right)+m\right|=\left|x^2-4x+5+m\right|\)
\(h\left(0\right)=5+m;h\left(4\right)=5+m;h\left(2\right)=1+m\)
TH1: \(1+m>0\Leftrightarrow m>-1\)
\(max=5+m=9\Leftrightarrow m=4\left(tm\right)\)
TH2: \(5+m< 0\Leftrightarrow m< -5\)
\(max=-1-m=9\Leftrightarrow m=-10\left(tm\right)\)
TH3: \(5+m>0>1+m\Leftrightarrow-5< m< -1\)
Nếu \(5+m< -1-m\Leftrightarrow m< -3\)
\(max=-1-m=9\Leftrightarrow m=-10\left(tm\right)\)
Nếu \(5+m=-1-m\Leftrightarrow m=-3\)
\(max=5+m=2\ne9\)
\(\Rightarrow m=-3\) không thỏa mãn yêu cầu bài toán
Nếu \(5+m>-1-m\Leftrightarrow m>-3\)
\(max=5+m=9\Leftrightarrow m=4\left(tm\right)\)
Vậy \(m=4;m=-10\)