Determine the y-coordinate of the critical point for the function where 0<x<5?

I got the derivative which is -1/x^2 + 1/(5-x)^2 but I don't know how to get the answer. The answer is y=4/5 but I was wondering how do you get that?

You did not state what the function is , but from your derivative I deduced it had to be

y = 1/x + 1/(5-x) + C

setting your derivative equal to zero
1/(5-x)^2 = 1/x^2
(5-x) = x^2
25 - 10x + x^2 = x^2
x = 2.5

sub that back into y = (your equation) and you should get y = 4/5