# Are piecewise functions continuous?

Determine which of three $$2\pi$$-periodic functions are continuous:

$$f_1(x)= \begin{cases} 0 & \text{for x\in[0,\pi[} \\ 4\pi-x & \text{for x\in[3\pi,4\pi[} \\ \end{cases}$$

$$f_2(x)= \begin{cases} \cos(\frac{x}{2}) & \text{for x\in[0,\pi[} \\ \frac{1}{\pi^2}(x-3\pi)^2 & \text{for x\in[3\pi,4\pi[} \\ \end{cases}$$

$$f_3(x)= \begin{cases} \sin(\frac{x}{2}) & \text{for x\in[0,\pi[} \\ -\cos(x) & \text{for x\in[3\pi,4\pi[} \\ \end{cases}$$

Attempt

By definition, a function is continuous if and only if $$\lim_{x\rightarrow x_0}f(x)=f(x_0)$$ for all points in the functions range.

I tried plotting the three piecewise function to see for which the above definition holds, and it seems like it's only $$f_2(x)$$ that follows the definition. However, the function still has "gaps" and I'm therefore in doubt if it actually is a continuous function. Can someone clarify this for me?

Here are the plots: - You're failing to account for the fact that $$f_1$$, $$f_2$$, $$f_3$$ all have periods of $$2\pi$$. As such, each of the functions is defined on all of $$\mathbb R$$. Nevertheless, your question opens up a point I think is important to address.

By your definition of continuity, none of your plotted functions are continuous. This is because in order for a limit $$\displaystyle{\lim_{x\to x_0}f(x)}$$ to exist, the function must be defined in some open interval containing $$x_0$$. This won't happen in any of your functions at $$x_0=\pi$$.

However, there are other definitions of continuity, whereby a function is also continuous at $$x_0$$ if either one-sided limit exists, and the function is undefined on the other side. Under these definitions, all three of your plotted functions would be continuous.

So, the answer to "which of the functions corresponding to these three plots is continuous?" can be either "none" or "all" depending on the fine points of your definition of continuity. As to the original question, I'll leave that up to you.

• Hmm, it sounds like you are hinting that my "definition" of continuity is not correct. Perhaps I should make some amendments to it. – Carl Nov 16 '20 at 18:58
• @Carl Your definition of continuity is correct, but not unique. The Wikipedia article on continuity, section History, outlines this in some more depth. – ViHdzP Nov 16 '20 at 19:04

$$f(x)$$ is continuos at $$x=c$$ given that: $$\lim_{x\to c^-} f(x) = \lim_{x\to c^+} f(x) = \lim_{x\to c} f(x) = f(c)$$ Hence, $$f(c)$$ must be defined. $$f_2(x)$$ is not defined for every real number $$x$$ so it is not a continuous function.

• I'm not sure I understand. What number is $f_2(x)$ not defined at? – Carl Nov 16 '20 at 19:10
• $x=2\pi$ for example? – trancendentalFork Nov 16 '20 at 19:15
• But $x=2\pi$ is not in the definition range for $f_2(x)$. I also don’t understand how you can say “$f_2(x)$ is not defined for every real number so it is not continuous.” The function $1/x$ is not defined for every real number either (not at x=0) but it is still continuous. – Carl Nov 16 '20 at 19:30