How do I know the lentils have gone bad?
Dried lentils don't go bad as such if stored sensibly (i.e. dry), but they do go hard and take longer to cook.  It's always possible they were stored for some time before you cought them.  An overnight soak before cooking can help. Other tips include:


not adding salt/acid/sugar until they've softened,
avoiding hard water
making the water slightly alkaline with some baking soda (slightly at odds with the previous point, but I suspect calcium in hard water may have something to do with it given the use of calcium compounds as firming agents) 


It's not definitive, so you need to apply common sense, but when pulses do spoil they smell terrible as soon as you open the container.  They'd also be slimy, because they have to be wet to spoil.