Piecewise Functions and Continuity of Functions

Piecewise function: uses a different formula for different parts of its domain
Continuity: if a function is continuous at a point, the graph pases through the point without a break

An example of a piecewise function:
\(f(x) = \begin{cases} x^2 - 3 & \text{if } x \leq -1\\ x - 1 & \text{if } x > -1\\ \end{cases}\)
Original functions are shown in red, the blue is the piecewise function

Continuity

\(f(x) = \begin{cases} 1 - x & \text{if } x \leq -2 \\ x^2 & \text{if } -2 < x \leq 2 \\ 4 & \text{if } x > 2 \\ \end{cases}\)
Results in this:

The function is discontinuous at \(x = -2\) and continuous at \(x = 2\).

Algebraic Approach

\(\begin{cases} \text{if } x < -2 & f(-2) = 1 - (-2) = 3 \\ \text{if } x = -2 & f(-2) = 1 - (-2) = 3 \\ \text{if } x > -2 & f(-2) = (-2)^2 = 4 \\ \end{cases}\)
At \(x = -2\) the results are not the same therefore the function is discontinuous at \(x = -2\).
\(\begin{cases} \text{if } x < 2 & f(2) = (2)^2 = 4 \\ \text{if } x = 2 & f(2) = (2)^2 = 4 \\ \text{if } x > 2 & f(2) = 4 \end{cases}\)
At \(x = 2\) all the numbers are the same therefore the function is continuous at \(x = 2\).