When peanut butter is going bad it will start to change texture and start becoming hard instead o being soft and creamy.
The peanut butter may still be good to eat even when it's becoming hard but if the peanut butter has a rancid smell to it or it smells different than normal then the peanut butter is bad and needs to be thrown out.
Fresh and Good peanut butter should be soft and creamy and easy to scoop out with a butter knife or a spoon and be easy to spread onto bread or other foods but if it's hard then it's likely gone bad or is going bad.
Another common trait of bad peanut butter is that it may become darker in color than it normally would be.