Just want to share on how did I solve my problem.
I have an iphone 4s and had never had any problem on connecting to wifi before. But when I moved to a new apartment, my iphone just cannot constantly stay connected with this perticular apartment wifi. I thought it was my iphone problem since other device can connect well in the apartment, but later I found out my iphone can connect very stably in a friend's apartment and at work place.
I did "forget the network", "reset network on iphone", "reset router", etc, but this problem still show up. I can connect, but will lost the connection in 2 min, then I will have to forget the network, re-enter password, and then lost connection in 2 min again.
There was once that I resetted my router and haven't put any password on, I found out that my iphone can stay connected!!! But of course it is not good to keep the wifi without password. Then I realize this might be a security authentication problem. I found out WAP and WAP2 doesn't work for my iphone, but WEP works!!! As long as I use a WEP password authentication on my router, my iphone can connect well!
I don't know why since my friend's apartment's router also use WAP which didn't cause trouble to my iphone, but it just doesn't work on my apartment router. I guess it related with other router setting which I don't quite know.
Good luck to everyone trying to solve this problem. Not be able to connect to wifi is quite bad...