wished to ask if it was legal to fly an aircraft if you had a non operative APU
It is perfectly legal - no problem with that.
And if it is an essential piece of equipment should an engine fail
No, it's not. In any case you still have at least the other engine with its generator supplying electrical power.
On some types it is not even possible to start the APU in flight (I think B744 is one of those).
And there are even other types, which don't even have an APU (DC8 comes to mind).
So all in all, it is legal and SAFE to fly without APU. In extreme weather conditions on ground it might just be a matter of passenger comfort.