Hi!
I had the same problem for the past three weeks!
I bought a my first Apple product, a MacBookPro, 13', i7 seven weeks ago. I was able to connect to my WiFi fine up until three weeks ago when all of a sudden it would give itself a self-assigned IP address. I was quite disturbed because I had high expectations from Apple. Regardless, I still love my MBP and set out to fix it!
I tried disconnecting/re-connecting wires, fiddling with network preferences, disabling firewalls, etc etc. Nothing worked. So I called up my internet service provider. That agent was unable to fix my problem because even with an ethernet cable stuck in my laptop, my router wouldn't assign my MBP a IP address. Sadly, that agent decided to upgrade my internet package without my consent and made my life quite miserable for the following ten days...that's a whole other story.
The point is that once I set up my new router I was hoping it would solve my self-assigned IP address issue if it was in fact a router problem. That was not the case. Fortunately though I was able to connect by ethernet. After a few days I thought to myself, let's try take a look at my security preferences. I noticed that I had my MAC filtering enabled....no wonder I wasn't on the allow list...so I disabled it then WHAM I HAD WIRELESS INTERNET!!!!!!! This explained why my MBP wouldn't even accept my network password, but it didn't explain why I was still getting a self-assigned IP address even with my neighbour's open network :S
An interesting observation I made was that the IP address that my MBP is using is the one that it was using via ethernet. I'm not well versed in these technical details, but I think the router may generally assign a particular IP address to each device, so whether that device connects via ethernet, or wireless, it'll give it that unique IP address. If this is supposed to be common knowledge then my apologies. What I would then suggest is trying to manually assign that very IP address to see it the device picks up the wireless internet.
I hope this will help guide some people in their quest to resolve this self-assigned IP address problem. I spent weeks trying different remedies. I didn't come across this one, so I thought I would share it.