The Book of the Sunnah
كتاب المقدمة
Chapter 45: Gaining benefit from knowledge and acting in accordance with it
"I heard the Messenger of Allah say: 'Do not acquire knowledge in order to show off before the scholars, or to argue with the foolish, or to attract people's attention, for whoever does that will be in Hell.'"
"The Messenger of Allah said: 'Whoever seeks knowledge in order to argue with the foolish, or to show off before the scholars, or to attract people's attention, Allah will admit him to Hell.'"
Chapter 46: One who is asked about knowledge but conceals it
The Prophet said: "There is no man who memorizes knowledge then conceals it, but he will be brought forth on the Day of Resurrection bridled with reins of fire." (Hasan)Another chain with similar wording.
"By Allah, were it not for two Verses in the Book of Allah, I would never have narrated anything from him, meaning from the Prophet, were it not for the Words of Allah: Verily, those who conceal what Allah has sent down of the Book, and purchase a small gain therewith (of worldly things), they eat into their bellies nothing but fire. Allah will not speak to them on the Day of Resurrection, nor purify them, and theirs will be a painful torment. Those are they who have purchased error at the price of guidance, and torment at the price of forgiveness. So how bold they are (for evil deeds which will push them) to the Fire.'"
"The Messenger of Allah said: 'When the last people of this Ummah curse the first, (at that time) whoever conceals a Hadith will be concealing what Allah has revealed.'" (Maudu')
'I heard Anas bin Malik say: "I heard the Messenger of Allah say: "Whoever is asked about knowledge and conceals it, it will be bridled on the Day of Resurrection with reins of fire.'"
"The Messenger of Allah said: 'Whoever conceals knowledge which Allah has made beneficial for mankind's affairs of religion, Allah will bridle him with reins of fire on the Day of Resurrection."
"The Messenger of Allah said: 'Whoever is asked about knowledge that he has and he conceals it, will be bridled on the Day of Resurrection with reins of fire.'"