3

Fixing Your Syntax
You need to pull the Id from your record. To make your attempt work, you would have to do:
Id accountOwner = [SELECT Account.OwnerId FROM Task WHERE Id = :myTask.Id].Account.OwnerId;
Trigger Best Practice
However, this approach is not bulk safe. What you should really be...