The graph of g(x) is a horizontal shift to the left of the graph of f(x). Therefore, k must be negative. Since the graph of g(x) is shifted 2 units to the left, k = -2.
Let f(x) be the function represented by the blue graph, and let g(x) be the function represented by the green graph. Then the given information can be expressed as the equation g(x)=f(x+k).
If h is a real number, then the graph of f(x+h) is the graph of f(x) shifted h units to the left. (If h is positive, the graph is shifted h units to the right.) Thus, the graph of g(x)=f(x+k) is the graph of f(x) shifted k units to the left.
From the graph, we see that the graph of g(x) is shifted 2 units to the left of the graph of f(x). Therefore, k= −2