Well, they obviously look similar, other than one being specific points and one being a line. They share the points (1, -1), (2,1), etc.
The graph of f(x) may extend through the y-axis and into quadrant 3.
Since the graph of the sequence is showing us that the first number in the sequence is -1, the 2nd is 1, etc, the domain is all positive whole numbers (there's no negative first number, for example, or a "zero" number). The range is -1 to infinity.
The domain and range of the function depends on what the graph actually looks like. If the graph is continuous in both directions, they are both negative infinity to infinity. If the graph starts at (0,-3), the range is from 0 to infinity and the range is -3 to infinity.