The necessary and sufficient conditions for continuity of a map between topological spaces in terms of the inverse images of open (or closed) sets Can we make the following definition? 

Let $X$ and $Y$ be topological spaces, and let $p$ be a point of $X$. Then a function $f \colon X \to Y$ is continuous at $p$ if, for every open set $V$ in $Y$ such that $f(p) \in V$, there is an open set $U$ in $X$ such that $p \in U$ and $f(U) \subset V$. 

Is this definition the required generalisation of the classical $\varepsilon$ $\delta$ - definition? 
Now can we prove the following theorem? 

Let $X$ and $Y$ be topological spaces, and let $p$ be a point of $X$. Then the function $f \colon X \to Y$ is continuous at $p$ if and only if, for every open (respectively, closed) set $V$ in $Y$ such that $f(p) \in V$, the inverse image $f^{-1}(V)$ is open (respectively, closed)  in $X$. 

Is this statement correct? If so, then how to prove it? 
My Attempt: 

First, suppose that, for every open set $V$ in $Y$ such that $f(p) \in V$, the inverse image $f^{-1}(V)$ is open in $X$. Let us take $U$ to be this inverse image. Then $p \in U$ and 
  $$ f(U) = f \left( f^{-1}(V) \right) \subset V, $$
  as required. 
Conversely, suppose that $f$ is continuous at $p$, and let $V$ be an open set in $Y$ such that $f(p) \in V$. As $f$ is continuous at $p$ and as $V$ is an open set in $Y$ such that $f(p) \in V$, so  there is an open set $U$ in $X$ such that $p \in U$ and $f(U) \subset V$. So we can conclude that $$p \in U \subset f^{-1} \left( f(U) \right) \subset f^{-1}(V), $$ 
  and hence $p \in U \subset f^{-1}(V)$. 

What next? 

Your proposed theprem is not even true in the $\epsilon\delta$ version and with $X=Y=\Bbb R$. Consider
$$ f(x)=\begin{cases}0&x\in \Bbb Q\\x&x\notin\Bbb Q\end{cases}$$
Then $f$ is continuous at $p=0$, but for all open sets $V$ of the form $V=(-a,a)$. the inverse image $V\cup \Bbb Q$ is not open. Same for closed $V$
