To know the y-intercept of a function, it simply suffices to evaluate the function at x=0. The result would be the y - intercept.
In our case, f(x) = -x^2+5x+2. To get the y-intercept of f, we replace x by 0, so we get
So the y-intercept of f is 2.
From the graph, we can see that g crosses the y axis at the point y=2, so the y-intercept of g is also 2.
Then, both f and g have the same y-intercept (2).