Given a set of distinct points in 2D space, and a rectangle (coordinates of all four points, sides parallel with xy axis) how can I quickly find which points are inside the rect
A classical answer is the kD-tree (2D-tree in this case).
For a simple alternative, if your points are spread uniformly enough, you can try by gridding.
Choose a cell size for a square grid (if the problem is anisotropic, use a rectangular grid). Assign every point to the grid cell that contains it, stored in a linked list. When you perform a query, find all cells that are overlapped by the rectangle and scan them to traverse their lists. For the partially covered cells, you will need to perform the point-in-rectangle test.
The choice of the size is important: too large can result in too many points needing to be tested anyway; too small can result in too many empty cells.