I'm reviewing some old undergrad notes of mine and came across this continuity question.
"Let $f:(-\infty,0]\to\mathbb{R}$ and $g:[0,\infty)\to\mathbb{R}$ be continuous functions on the entirety of their respective domains. Now let us define the function $h:\mathbb{R}\to\mathbb{R}$ by:
$$h(x)= \begin{cases} f(x) & x\le{}0\\ g(x) & x>0\\ \end{cases} $$ Show that $h$ is continuous at $c=0$ iff $f(0)=g(0).$" The backward implication was no trouble at all but I am having trouble in the forward direction.
My attempt:
Suppose $h$ is continuous at $c=0$.
Fix $\epsilon>0$. Choose $\delta_f,\delta_g,\delta_h>0$ that satisfy the definition of continuity at $f,g$ and $h$, respectively, at $c$ w.r.t the fixed $\epsilon$. Define $\delta:=\min(\{\delta_f,\delta_g,\delta_h\})$.
Now fix $x\in(c-\delta,c+\delta)$.
Case 1 $(x>0)$: $$|f(0)-g(0)|=|h(0)-g(0)|=|h(0)-g(x)+g(x)-g(0)|\le{}|h(0)-g(x)|+|g(x)-g(0)|$$ $$=|h(0)-h(x)|+|g(x)-g(0)|<2\epsilon$$
Which is true for any choice of $\epsilon>0$ which forces $f(0)=g(0).$ So we are done.
Case 2 $(x\le0)$:
$$|f(0)-g(0)|=|f(0)-h(x)+h(x)-g(0)|\le{}|f(0)-h(x)|+|h(x)-g(0)|=|f(0)-f(x)|+|h(x)-g(0)|$$
This is were I get stuck. Can this proof work in this way? Is there a nicer way to achieve the same result?
Hints would be more appreciated.
Why don't you just say, if $h$ is continuous at $0$ then
$$f(0)=h(0)= \lim\limits_{x \to 0^+} h(x) = \lim\limits_{x \to 0^+} g(x) = g(0)?$$