As in any society, how you dress affects your experiences. Your fashion choices make a statement about your interests or intentions, and these statements are subject to cultural interpretation. The last few decades in Western countries have seen a revolution in fashion ideas, especially among the young, that would have shocked Westerners even two generations back. Though a small segment of urban India has been exposed to, and often accepted new fashion directions, most Indians hold a more conservative view.
While visiting India the traveler must decide from which culture to approach the country. Many Western travelers rarely seem to be able to put their own culture temporarily on hold and take a clear look at the new culture around them. The thinking seems to go "If, in Amsterdam men can wear tiny shorts and not much more on a hot, summer day and in L.A. women feel well dressed in a halter-top and cycling shorts why not dress that way in India?"They don't seem to notice that not one single adult Indian, male or female, wears shorts in public. Most Indians would consider wearing that skimpy an outfit to be about the same as wearing underwear. Indian tolerance ensures that such travelers get a better reception than if they tried walking around New York City in their knickers, but it does affect perceptions.
Dress for the culture
Many travelers dress for their fellow travelers. The logic seems to be if it is funky in Toronto, why not Madras. The problem is that in Madras the majority of people you encounter will not have the Toronto perspective. Your funky outfit may come across as bizarre, comical, or overly suggestive. This is going to affect how people interact with you.
Your best guideline is to look around you, see what the locals are wearing, decide in good conscience what you would be comfortable wearing, and go from there. And adjust your dress as the situation changes. An outfit that will attract little attention on the beach at Kovalum or Goa may draw negative reactions in Hyderabad. And an urbane center like Bangalore will accommodate more casual dress than the temple town of Madurai.
What men should consider
As a general rule, urban Indian men wear western dress - some variation of long pants and a shirt. Western men wearing traditional Indian dress are quickly slotted into the "hippie" category. Look for comfortable cotton shirts, and loose, cotton or cotton blend trousers. Pure cotton shirts make a huge difference when it's hot. When the temperature approaches 35 Celsius you'll feel the difference of even a small amount of synthetic blend.
What women should consider
Dressing to fit in is more important for women who want to avoid unnecessary hassles. The standard advice is to cover your shoulders and your butt, and avoid showing cleavage. Definitely avoid the solid colored drawstring skirts sold everywhere. Those are petticoats to go under saris. Similarly, wearing the tight sari blouse with a pair of pants would be terribly suggestive. Wearing men's style Indian clothes will give a very confusing message as well.
Most Indian women wear some kind of traditional garment - the sari or the salwar kameez (baggy pants, long tunic top, and a scarf thrown over the shoulder). Saris are extremely difficult for Westerners to adjust to, but salwars are easy to wear and available ready made everywhere. They can be extremely cheap - as low as $5 for an outfit. If you can't find your size, you can have them tailored by any small tailoring outfit. Made of cotton, they are cool, flowing and elegant - suitable for any occasion, casual or formal. You'll be advertising an awareness of Indian conditions and will attract much less negative attention. Salwars are particularly well suited for train travel. If you have trouble with the scarf (which really should be worn) you can cheat by pinning it in place. Many do.
Clean & Neat
Taking the trouble to dress appropriately will be wasted if you're putting on wrinkled or grimy clothes. Indians are quite fastidious about their apparel. All but the very poorest wear freshly washed and ironed clothes. This jars with Westerner's casual, easy-care approach to clothing, but it's worth the effort to be clean and neat. Street side ironing booths will iron anything for a couple of rupees. Even the cheapest hotel will offer some kind of laundry and ironing service. Or you can wash things yourself. Most anything dries overnight. If you can't find the time to care for your clothes you're moving too fast.
There are a surprising number of young Western travelers moving about India who seemed to have abandoned all attempts at personal hygiene. Wearing dirty, stained clothing and with greasy matted hair it is possible they see themselves in solidarity with the very poorest of India's poor. Perhaps they are blissing out on a temporary detachment from material possessions. This may seem fine for privileged children of the West who are here with return tickets and adequate cash, but it offends and disgusts most Indians. In India, personal cleanliness is the most basic of virtues, and most people are fighting a daily battle to maintain whatever level of personal cleanliness and order that their socioeconomic situation allows.