Rental

I bought a duplex and live in the basement and am renting upstairs. Can I deduct depreciation on the part I am renting out? What happens when I sale it if I don't depreciate it? Also if I do take depreciation what does it do to my capital gain from the sale?

 

Also I made a lot of repairs to the house. Can I only deduct the repairs on the portion that I am renting out?