The graph of a function is shown. Which function is represented by the graph?

Answer: The correct option is 2.
Explanation:
From the given figure it is easily noticed that the function is increasing in nature for x<0 and the function is constant in nature for x>0 because the value of y remains unchanged for any value of x, where [tex]x\geq0[/tex].
The value of function is 3 at x=0.
The value of the function is always 3 for all [tex]x\geq0[/tex]. So,
[tex]f(x)=3[/tex] for [tex]x\geq0[/tex].
The function is a straight line with intercepts (-3,0) and (0,3).
The equation of line is,
[tex]y-y_1=\frac{y_2-y_1}{x_2-x_1}(x-x_1)[/tex]
[tex]y-0=\frac{3-0}{0-(-3)} (x-(-3))[/tex]
[tex]y=\frac{3}{3} (x+3)[/tex]
[tex]y=(x+3)[/tex]
For x<0, the function is,
[tex]f(x)=x+3[/tex]
Therefore the piecewise function can be defined as,
[tex]f(x)=\begin{cases}x+3 & \text{ if } x<0 \\3& \text{ if } x\geq0\end{cases}[/tex]
Therefore option 2 is correct.