Compactness and connectedness are preserved by continuous maps, thus the compactness and connectedness of $B$ imply the same properties on $A$, its image.
It is not necessarily open as the identity $\mathbb{R}^2 \to \mathbb{R}^2$ shows.
In most common cases, to be honest, the image is indeed closed. The hypothesis you have to require is $X$ to be an hausdorff space: every two points can be separated by opens. Precisely, for every $x,y \in X$ there exist disjoint opens $U,V$ such that $x \in U, y \in V$. This property is shared by almost everything geometric that come to your mind.
Still, there are counterexamples to "compact $\Rightarrow $ closed" without the hausdorff property. Define $X$ in this way. Its points are real numbers plus a special point, $z$. Its closed sets are a finite number of real points ( $z$ is not allowed) or the entire $X$. Then the one-point-set $\{z\}$ is of course compact because every open covering is made of one open (it is just one point!), but it is not closed: its closure is the whole $X$! The other closed sets do not contain $z$.
This example arise often in algebraic geometry. It is like we have added the real line itself as $z$ to the set of real numbers, and we declared it near to every point (every open contains $z$). This allow algebraic geometrists to make interesting tricks :)
In hausdorff case, the proof that a compact is closed is easy. Try to figure it out geometrically.
Let $K \subset X$ be a compact set, and let $p\not \in K$. We must show that there is an open set that contains $p$ and does not intersect $K$ (i.e., the complement is open). By hp, for every $x \in K$ there exist $x \in U_x , p \in V_x$ open sets which separate $x,p$. $\{U_x \}_x$ is an open covering of $K$, thus we can extract a finite covering $U_1, .., U_n$. Then the corresponding $V_i$ have intersection $V= \bigcap V_i$ which contains $p$ and it is disjoint by $\bigcup U_i \supset K$. Yuppi!