Let’s see what we can say about $\tau'$.
$X=g^{-1}[Y]$ and $\varnothing=g^{-1}[\varnothing]$, so $X,\varnothing\in\tau'$.
Suppose that $U_0,U_1\in\tau'$. Then there are $V_0,V_1\in\tau$ such that $U_0=g^{-1}[V_0]$ and $U_a=g^{-1}[V_1]$, and $U_0\cap U_1=g^{-1}[V_0]\cap g^{-1}[V_1]=g^{-1}[V_0\cap V_1]\in\tau'$, since $V_0\cap V_1\in\tau$. Thus, $\tau'$ is closed under finite intersections. (Remember that inverse functions commute with unions and intersections.)
Suppose that $\mathscr{U}\subseteq\tau'$. Then for each $U\in\mathscr{U}$ there is a $V_U\in\tau$ such that $U=g^{-1}[V_U]$, and $\bigcup\mathscr{U}=\bigcup_{U\in\mathscr{U}}g^{-1}[V_U]=g^{-1}\left[\bigcup_{U\in\mathscr{U}}V_U\right]\in\tau'$, since $\bigcup_{U\in\mathscr{U}}V_U\in\tau$. Thus, $\tau'$ is closed under arbitrary unions.
We’ve just shown that $\tau'$ is a topology on $X$, irrespective of whether $g$ maps $X$ onto $Y$.
For the last question, let $Z=X/\sim$, and let $q:X\to Z:x\mapsto[x]$ be the quotient map, where $[x]$ is the $\sim$-equivalence class of $x$. Define $h:Y\to Z$ as follows:
For each $y\in Y$, $g^{-1}\big[\{y\}\big]$ is a $\sim$-equivalence class, by the definition of $\sim$. Specifically, for each $x\in X$ such that $g(x)=y$, $g^{-1}\big[\{y\}\big]=[x]\in Z$. Let $h(y)=g^{-1}\big[\{y\}\big]\in Z$.
To complete the argument, just show that $h$ is a homeomorphism. I’ll leave it to you to show that $h$ is one-to-one and onto. To show that $h$ is continuous, suppose that $U\subseteq Z$ is open in $Z$; we need to show that $h^{-1}[U]$ is open in $Y$, i.e., that $h^{-1}[U]\in\tau$. By the definition of $\tau'$ this is true if and only $g^{-1}\big[h^{-1}[U]\big]\in\tau'$. By the definition of quotient space $q^{-1}[U]\in\tau'$. But for any $x\in X$ we have $x\in q^{-1}[U]$ iff $[x]\in U$ iff $g(x)\in h^{-1}[U]$, i.e., $q^{-1}[U]=g^{-1}\big[h^{-1}[U]\big]$, and therefore $g^{-1}\big[h^{-1}[U]\big]\in\tau'$, as desired.
It only remains to show that $h$ is an open map. I’ll leave this to you: it requires no ideas beyond those that I used to show that $h$ is continuous.