To write the equation of a rational function, the location of any vertical asymptotes will determine the linear factors that we place in the denominator (because x-values that make the denominator = 0 will create vertical asymptotes in the graph). So, we know that the denominator in the equation will be (x + 1)(x - 4).
Similarly, the location of any x-intercepts will determine the linear factors that we place in the numerator. Thus, our numerator will contain (x - 2).
Lastly, we can use an a-value as the leading coefficient, and solve for a to ensure that the y-intercept is (0,1):
f(x) = a(x - 2) / [(x + 1)(x - 4)]
f(0) = a (-2) / [(1)(-4)] = 1
1/2 · a = 1
a = 2
f(x) = 2(x - 2) / [(x + 1)(x - 4)]
You should graph this on a TI or Desmos to confirm it has the graphical features as given.