Yes, it would be a function. A function is a relation where each x has one and only one y value, which is true of the set of (x,y) ordered pairs in your problem. An example that would not be a function is:
{ (1,5), (2,4), (2,5), (3,5), 4,9) }
It would not be a function because the x-value of 2 has two different y values, (2,4) and (2,5).