To find specific books at local independent bookstores, search at
http://www.indiebound.org Search by book title, click on the book, and enter your zip code. Should work from an iPhone.
To search for a library book, you can use
http://worldcat.org, or now, with the RedLaser application, you can scan the barcode of a book and find out what libraries have it.
http://redlaser.com/