What is this flexible hose under my bathroom sink for?
It's a tap into the drain.  Likely for Air Conditioning (condensate) located nearby in the attic.

If this is proven to be the case you will want to familiarize yourself with how it works.  Is it all gravity?  Is there a pump?  Regular (annual) cleaning/flushing is important, as you don't want this to overflow.