As formulated, the question is not related to the operational amplifier. It is a question about the simple 2-resistor summing network R1-R2 driven by two voltage sources - Vref = 2.5 V and Vout = 0/5 V. In the first case it is a voltage divider driven from the left; in the second case it is a complete voltage summer driven from both sides (inputs).
Generally, its output voltage can be found by applying the superposition principle: V(+) = Vref.R2/(R1 + R2) + Vout.R1/(R1 + R2)... i.e., by summing the two partial output voltages of the voltage divider R1-R2 driven from the left and the voltage divider R2-R1 driven from the right.
For those who think visually, I offer two geometric interpretations:
...by a triangle...
... and trapezoid:
As for the full circuit, it is an op-amp inverting comparator with hysteresis. The answers to the question give its two thresholds.