According to the meaning of the question, the cost of supermarket A is 20×2 10+70(x-20) and that of supermarket B is 0.8(20×2 10+70x).
∫20×2 10+70(x-20)< 0.8(20×2 10+70x),
Solution: x < 40,
∴ When 20 ≤ x < 40, it is cost-effective to go to supermarket A;
(2) Because buying a bookshelf and giving it away is equivalent to a 30% discount,
So we should buy 20 bookcases and 20 bookshelves in supermarket A and 80 bookshelves in supermarket B, which costs 8680 yuan.