At first, I couldn't buy the Riften house so I decided to join the Thieve's guild and live there. When I finished all the Thieve's guild quests, I went to the Jarl's steward just to check it out again. Then there was an option to buy it and since I had 10,000 gold, I bought it.