It is obvious it is faulty, you should have taken it back immediately and got a replacement.
Where did you buy this from, some stores give a 30 day replace or refund.
All macs come with 90 days free telephone support from Apple Care, there should have been a card in the box
with a phone number.
All macs come with a full one year Apple warranty, if you cannot get it replaced, get it repaired.
Other stores may give a longer warranty.
It is a very expensive item and the least you should expect is that it works well from day one.
Get in touch with the store you bought it from and insist on a replacement, politely of course.