Was there a sellers' disclosure? Did you have a home inspection? Did you do a walk through? What exactly is not working? How recent was your purchase? We'll need more information to help you. Please include your location, too.
In NJ, before a buyer submits an offer, they check the sellers' disclosure (when available) that tells what the sellers know to be the condition of the house; then, buyers have inspections to check out the condition of the house with a professional which (hopefully) verifies the conditiion previously stated by the sellers, finally, on the closing day we perform a final walk through to be sure there have been no changes in the condition of the house. This generally protects buyers from any surprises after closing. If the day of the walk through something is discovered, it is brought to the attention of the attorneys and money can be held in escrow until the problem is remediated. After closing, any discoveries would have to be remediated through law suit. It is not that way in all states though, so please do post your location for a local agent to provide the way its done in that state.