Are "locally continuous" functions continuous?
YES.
It suffices to show that if $W\subset B$ is open in $B$ then $f^{-1}[W]$ is open in $A$.
We know that, for every $x\in A$, there exists an open $U_x\subset A$, $x\in U_x$, such that $f^{-1}[W]\cap U_x$ is open in $U_x$ and hence it is open in $A$. But $\bigcup_{x\in A}U_x=A$ and hence $$ f^{-1}[W]=\bigcup_{x\in A} f^{-1}[W]\cap U_x. $$ The right hand side is an union of open sets, and hence open.