Example sentences
nǐ你wèi为shén什me么bù不qù去?
Why aren't you going?
wǒ我bù不zhī知dào道wèi为shén什me么。
I don't know why.
About this word
为 means for and 什么 means what, so 为什么 is "for what". English why is built the same way, from an old phrase meaning for what, and Chinese simply keeps the pieces visible. It is an ordinary question phrase rather than a fixed idiom, so the subject can slot into the middle: 你为什么不去 and 为什么你不去 both work, with a slightly different emphasis. 为什么 asks about cause, while 怎么 asks about manner and often carries a note of complaint.
The story behind the character
为
为 began as a hand on an elephant. The earliest forms show 爪 (a hand) above 象 (an elephant), and the usual reading is that people were putting elephants to work. Xu Shen, writing a thousand years later, guessed it was a monkey. 為, 母猴也, he wrote. He was wrong about this one. The elephant only turned up once scholars got a look at the oracle bones.
什
什 is 亻 (person) plus 十, and 十 is doing the phonetic work. Its old job was counting in tens, a unit of ten men. In 什么 it carries no meaning at all, only sound. The word itself is old colloquial: it was written 甚麼 first, and 什么 is just the worn-down modern spelling.
么
么 is the small one. The traditional 麼 is 麻 (hemp) with 幺 underneath, and 幺 means tiny, a little thread. Xu Shen wrote 麼, 細也: fine, slight. These days it survives mostly as a suffix with no meaning of its own, the 么 in 什么, 怎么 and 那么.