Step 1: Definition of Continuity.
A function is continuous at a point \( x = c \) if the following condition holds:
\[
\lim_{x \to c} f(x) = f(c).
\]
In this case, we need to prove that the function is continuous at \( x = 2 \), meaning we must show:
\[
\lim_{x \to 2^-} f(x) = f(2) = \lim_{x \to 2^+} f(x).
\]
Step 2: Left-hand Limit.
For \( x \leq 2 \), we use the expression \( f(x) = x^3 - 3 \). The left-hand limit is:
\[
\lim_{x \to 2^-} f(x) = \lim_{x \to 2^-} (x^3 - 3) = 2^3 - 3 = 8 - 3 = 5.
\]
Step 3: Right-hand Limit.
For \( x>2 \), we use the expression \( f(x) = x^2 + 1 \). The right-hand limit is:
\[
\lim_{x \to 2^+} f(x) = \lim_{x \to 2^+} (x^2 + 1) = 2^2 + 1 = 4 + 1 = 5.
\]
Step 4: Value of the Function at \( x = 2 \).
Since \( x = 2 \) is in the domain where \( x \leq 2 \), we use the expression \( f(x) = x^3 - 3 \) to find:
\[
f(2) = 2^3 - 3 = 8 - 3 = 5.
\]
Step 5: Conclusion.
We have shown that:
\[
\lim_{x \to 2^-} f(x) = f(2) = \lim_{x \to 2^+} f(x) = 5.
\]
Thus, the function is continuous at \( x = 2 \).