How can I see a query after rules have been applied?
There is no direct way to see an SQL representation of the rewritten query, because the rewriting happens on an internal tree representation, and it's not easy to turn this back into SQL.  The closest thing is turning on the configuration parameter debug_print_rewritten, which prints a representation of that internal tree format to the server log.  If you use this in conjunction with the settings debug_print_parse and debug_print_plan (and possibly debug_pretty_print), you can see how the query is transformed through the various stages.  The format isn't easy to read, but if you are interested in learning the details of this, it will probably be worth it.