The preimage of a maximal ideal is maximal

First of all note that the assumption that $A$ and $B$ be algebras over a field $k$ and $\psi$ is a $k$-algebra homomorphism is crucial, since the injection $\mathbb Z \hookrightarrow \mathbb Q$ shows that the pullback of $(0)$, which is maximal in $\mathbb Q$, is $(0)$ which is not maximal in $\mathbb Z$. Or you can take $A=k[X] \hookrightarrow B=k(X)$, the natural injection of a polynomial ring into its function field and again pull back the zero ideal.

To prove this, since it's a homework problem, I'm going to assume the following lemma for a $k$-algebra $A$: (a) If $A$ is a domain such that every element $a \in A$ is the root of a non-zero polynomial in $k[X]$ (i.e. $A$ is algebraic over $k$), then $A$ is a field; (b) if $A$ is a field and is contained in an affine $k$-algebra domain, then $A$ is algebraic over $k$.

These are basic results which you should have covered, but I'll sketch the proof of this lemma before proceeding. For part (a), let $a \in A$, it suffices to show $k[a]$ is a field, and you may assume $A=k[a]$. Consider the map $k[X] \rightarrow A$ mapping $f$ to $f(a)$, let the kernel be $I$, show $A \cong k[X]/I$, and since $a$ is algebraic over $k$, $I \neq 0$. But $k[X]$ is a PID, so $I=(f)$ for $f$ irreducible, so $I$ is maximal and $A$ is a field. Part (b) takes more work, I'm afraid, but in the case $k=\mathbb C$ is algebraically closed, it's easier to see.

Given this lemma, define a map $A \rightarrow B/ \mathfrak m$ by sending $a$ to $\psi(a)+ \mathfrak m$, which has kernel $\psi^{-1}(\mathfrak m)=: \mathfrak n$. Hence, $A/ \mathfrak n$ is isomorphic to a subalgebra of $B/ \mathfrak m$. By part (b) of the lemma above, $B/ \mathfrak m$ is algebraic over $k$, hence $A/ \mathfrak n$ is also algebraic over $k$, and a domain, so by part (a) of the lemma, it's a field and so $\mathfrak n$ is maximal.