Multiple Push buttons to one input
Michel Keijzers pointed out the issues you have in your code. But then
there is also an issue with your circuit: if you press any of the push
buttons, the analog input pin gets connected to one of the nodes of the
resistor ladder, and you get a well defined voltage reading. Good.
However, if none of the buttons is pressed, the input is not connected
to anything: it is floating. In this case the reading you get is
unpredictable, as it depends on parasitic influences of stray
capacitances, environmental noise, etc. You should modify your circuit
to make sure that the input voltage is well defined even when no button
is pressed.
Then, regarding the program, I recommend you remove everything after
Serial.println(temp);. Just make it work like this, and take note of
the readings you get in each case. Make sure they are consistent. Once
you know the values you expect, you can decide on the threshold to
apply, which should be about halfway between the typical readings. E.g.
if the two lowest values you get are 0 and 240, you would set a
threshold at 120.