continuous functions and basis

Given a function on topological spaces and where is a topological basis for , it is sufficient to check if f is a continuous map for all the basis elements

In other words if

then f is a continuous function.

Proof

For any open set then

Therefore,

So if all are open then is open