Right,
Thanks for posting your code properly. When it comes to other people's code I am not the best, there are people here who amaze me at their ability to cut through what others are trying to do and be helpful, I am not as good as them. Hopefully one of them will offer help.
With that said this is what I think:
I agree with slipstick when he said:
It's like you're going out of your way to confuse things.
It seems to me that you are trying to do something with bits and pieces you have picked up without understanding what they are for. You need to learn the basics, which you can do by working through the tutorials on this web site, in the IDE and elsewhere.
The following stood out for me as, well, daft TBH:
You declare:
int buttonPin = 7;
But then use:
pinMode(7, INPUT_PULLUP);
What is the point of giving the pin a name if you don't use it?
int buttonstate = digitalRead(7);
switch (buttonstate) {
case LOW:
cutpower();
break;
}
What is the point of switch with only one case?
void cutpower() {
if (rpm >= Speed && digitalRead(buttonstate) == LOW)
{
digitalWrite(relay, HIGH);
delay(25);
digitalWrite(relay, LOW);
delay(25);
}
}
The only way you can get to the function cutpower() is if buttonstate is low, so why read it again?
While delay is OK for initial learning and playing about it will not serve you well, it will make your code slow and unresponsive and you need to learn to not use it but use millis() instead. Also, pulseIn() is blocking and as bad as delay.
Learn the basics, look at how others write code and try again.
Have fun.