I hope I've interpreted your question correctly...I'll edit it if I'm wrong.
If the question you've attached is the original function, you're just supposed to work out the gradients for each line.
So from [-3,0) the gradient will be 2/3. From (0,3] the gradient is -5/3. So for graphing the gradient function you would draw y=2/3, -3<x<0 and y=-5/3, 0<x<3
Note that the end points cannot be differentiated so mark them with open circles on your gradient graph.
For parabolas and cubics etc, they generally just want a reasonable estimate. x-ints of the gradient function are simply where stationary points are i.e. dy/dx=0, and be sure to check end points and discontinuity. Sometimes you can actually work out what the original function is from the graph with enough information, but usually they don't even care about that.