1. This is a basketball uniform. The uniform is composed of a T-shirt and trunks. A basketball is on the trunks. He enjoys playing basketball.

(Is this passage grammatical? Check it, please.)

2. There are many books on the bookshelf.
3. There are many books in the bookshelf.
(Are both grammatical? Do we have to use 'in' or 'on'?)

1 is fine, yes.

2 is correct; 3 is incorrect.