If $\phi: G \rightarrow H$ is a homomorphism, then $\phi(1_G) = 1_H$ - proof verification I have two proofs on "if $\phi: G \rightarrow H$ is a homomorphism, then $\phi(1_G) = 1_H$".
The first one is the one in the lecture notes:

Let $\phi(1_G) = h$. Then $1_Hh = h = \phi(1_G) = \phi(1_G1_G) = hh$. So $h = 1_H$.

Which is fine. Here is my proof, which is a copy of a proof for isomorphisms:

By definition, $1_Gg = g = g1_G$. Then $\phi(1_Gg) = \phi(g) = \phi(g1_G) \implies \phi(1_g)\phi(g) = \phi(g) = \phi(g)\phi(1_G) \implies \phi(1_G) = 1_H$, by definition.

Which is fine if $\phi$ is an isomorphism.
But I feel that this is wrong in the case that $\phi$ is a homomorphism since we do not have bijectivity, so we cannot assume that for all $h \in H$ there exists a $g \in G$ such that $\phi(g) = h$.
Am I correct in thinking this?
Also, is it okay to use the proof for homomorphisms for the isomorphism case?
 A: The second proof is correct, but not for the reason you state.
It is incorrect to conclude that $\phi(1_G) = 1_H$ because $\phi(1_G)$ satisfies the definition for $1_H$. For that, you need $\phi(1_G)h = h\phi(1_G) = h$ for all $h\in H$, which as you and Ennar noted, requires surjectivity.
However, as Tobias mentions in the comments, by the virtue of the fact that you have $\phi(1_G)\phi(g) = \phi(g)$, that is enough to finish the proof. Since we are working with groups, we know that $\phi(g)$ is invertible. Then we have
$$\phi(1_G) = \phi(1_G)1_H = \phi(1_G)\phi(g)\phi(g)^{-1} = \phi(g)\phi(g)^{-1} = 1_H.$$
A: In order to see where your proof fails, consider the situation where $G$ is a group and $\mathbb{N}=\{0,1,2,\dotsc\}$ is considered as a semigroup under multiplication. Actually we consider the semigroup $\mathbb{N}\times\mathbb{N}$ under componentwise multiplication, which has $(1,1)$ as identity.
The map $\varphi\colon G\to \mathbb{N}\times\mathbb{N}$ defined by $\varphi(g)=(1,0)$ certainly satisfies $\varphi(g_1g_2)=\varphi(g_1)\varphi(g_2)$, but it is false that $\varphi(1_G)$ is the identity of the codomain.
The moral of this is that you need to use the group properties. The case of isomorphisms is different: your argument would be fine if $\varphi$ is surjective.

The proof in the book is of course correct. Moreover, it uses the minimum it can.
The only element you know in $G$ is $1_G$; so if the result is true, it can be proved using just that element. It relies on a simple lemma.

Let $G$ be a group and $x\in G$; if $xx=x$, then $x=1_G$.

Indeed, from $xx=x$, we get $(xx)x^{-1}=xx^{-1}$; by definition of inverse and by associativity, we get $x=1_G$.
Now you can apply the main property of $1_G$, that is, $1_G1_G=1_G$; so
$$
\varphi(1_G)=\varphi(1_G1_G)=\varphi(1_G)\varphi(1_G)
$$
So you get $y=\varphi(1_G)\in H$ that satisfies $y=yy$; by the lemma, $y=1_H$.
