We are taught not to lie ever, but in self preservation Abraham lies about who Sarah is. What is going on?
There is a difference between what the bible records for us and what it recommends. In no way are Abraham's actions recommended, they are simply reported. That God preserves and protects Abraham and Sarah is testimony to his grace and faithfulness to his promises.
In this instance Abraham is not an example for us to follow. We are instead to be like God who does not lie.