Are these two sentences right ?
Five books were what I bought yesterday .
What I bought yesterday was five books.
Both are grammatically correct. Concerning 'b', you can also use 'were'. Michael Swan 3rd edition indicates such a point and explains it in detail page 522. He says, "In English a verb normally agrees with the subject of a sentence, not with a following complement."
- The biggest time-waster is meetings.
He goes on saying, "However, if the subject is a long way from the verb, people sometimes make the verb agree with a complement." and then he comes to the answer to your question saying, "This often happens, too, when the subject is a relative what-clause, especially when the complement is long."
- What I am most interested in is/are your immediate personal reactions.
- What we need is/are a few bright young engineers.