The gravitational force between two masses is proportional to
(mass-1) x (mass-2) / (the distance between them)-squared
Do you see (distance-squared) in the denominator there ?
That steers you straight to the function [ y proportional to 1/x² ] ... in the middle.