For the function to be continuous at $ x = -1 $, the left-hand limit, right-hand limit, and the function value at $ x = -1 $ must all be equal. That is:
\[
\lim_{x \to -1} f(x) = f(-1)
\]
Step 1: Simplify the expression for $ f(x) $ when $ x \neq -1 $:
\[
f(x) = \frac{x^2 - 2x - 3}{x + 1}
\]
Factor the numerator:
\[
x^2 - 2x - 3 = (x - 3)(x + 1)
\]
Thus:
\[
f(x) = \frac{(x - 3)(x + 1)}{x + 1}
\]
For $ x \neq -1 $, cancel out $ x + 1 $:
\[
f(x) = x - 3
\]
Step 2: Find the limit as $ x \to -1 $:
\[
\lim_{x \to -1} f(x) = \lim_{x \to -1} (x - 3) = -1 - 3 = -4
\]
Step 3: For continuity at $ x = -1 $, we must have:
\[
f(-1) = k = -4
\]
Thus, the value of $ k $ is $ \boxed{-4} $.