Following a strategy of consistently going against the current views of the market is called contrarian investing.
For example, contrarian investors are likely to sell shares that are currently favoured, and buy shares that are out of favour. They are also likely to prefer sectors, markets or types of investments that other investors avoid and sell whatever is generally well regarded.
Contrarian investing can be very successful during bubbles and busts as contrarian investors are likely to sell during a bubble and buy when the investors are unduly pessimistic about shares. The problem is that the market is right most of the time and therefore contrarians will find it hard to do well most of the time.
Out-performing the market (assuming that it is not due to pure luck) must involve spotting investments that the market has failed to price correctly. Thus far contrarians are right. However, they go further and assume that the way to spot opportunities to outperform is to assume that most investors are wrong. This is sometimes true (as during bubbles), what is questionable is whether it is true enough of the time to be a good strategy.
Few investors are likely to be simple contrarians who automatically do the opposite of what the majority thinks. Many contrarians are likely to follow the more sensible strategy of looking at what market prices assume and looking for the occasions where the opposite is likely to be true. Most contrarians, when it comes to specific decisions, make much the same arguments as would a growth or value investor who favours the same investments.