[Math] Prove continuity of piecewise function using epsilon-delta

continuityfunctionsreal-analysis

Suppose we have a function $\phi$ so that

$$\phi (x)=\cases{f(x) & \text{ if } x\le 0\\
g(x)& \text{ if } x>0.}$$
where $f$ is continuous on $(-\infty,0]$ and $g$ is continuous on $(0,\infty)$, and suppose $f(0)=g(0)$ (that is, the value of $g(0)$ if $g$ were extended to a continuous function on $[0,\infty)$, which it can be by some theorem). For example, we could have:

$$\phi (x)=\cases{x & \text{ if } x\le 0\\
x^2& \text{ if } x>0.}$$

How can we rigorously show that $\phi$ is continuous at $0$, using either the $\epsilon, \delta$ definition OR the equivalent definition that $\phi$ is continuous at $x_0$ iff for every $(x_n)$ with $x_n \to x_0$ we have $\phi(x_n)\to \phi(x_0)$?

I have seen this proof by looking at the both the left and right side continuity (such as here), but I'm not sure how that's rigorous only assuming the above two ways to prove continuity (since we have to consider every $(x_n)$, not just $(x_n)$ approaching from the left or the right). I suppose a proof of this left-right continuity would also suffice, but a proof using either of the two above methods in a nice way would be slicker I think, if possible.

Is the way to go about it by actually extending $g$ to the extra point at $0$ and noting that $g(0)=f(0)$? If so, how can that be made rigorously precise?

Best Answer

By continuity of $f$ and $g$,

$\forall \epsilon>0, \exists \delta_{f,\epsilon} >0, |x| \leq \delta \implies |f(x)-f(0)| \leq \epsilon$

$\forall \epsilon>0, \exists \delta_{g,\epsilon} >0, |x| \leq \delta \implies |g(x)-g(0)| \leq \epsilon$

Hence Let $\delta_{\epsilon}=\min(\delta_{f,\epsilon},\delta_{g,\epsilon})$,

$\forall \epsilon>0, |x|\leq \delta_{\epsilon} \implies |\phi(x)-\phi(0)|\leq \epsilon$