The problem wants to show that is a natural way to endow a set $Y$ with a topology when we have a function $f: X \to Y$ where $X$ already has a topology. This obeys a nice universal property (your $2$.) and is essentially unique with that property.
There also is a unique smallest topology that makes $f$ continuous but this will always be the indiscrete topology $\{\emptyset, Y\}$ and says nothing of interest about $f$, really.
For existence: just check the axioms of topology for
$$\mathcal{T}=\{O \subseteq Y: f^{-1}[O] \text{ open in } X\}$$
using identities like $$f^{-1}[\bigcup_i O_i]=\bigcup_i f^{-1}[O_i]$$ and similar ones for intersection, plus the fact that $f^{-1}[\emptyset]=\emptyset$ and $f^{-1}[Y]=X$ for any map $f:X \to Y$ too.
This obeys 1. because if $\mathcal{T}'$ is any arbitrary topology on $Y$ that makes $f$ continuous, then for all $O \in \mathcal{T}'$ we have that $f^{-1}[O]$ is open in $X$ (by that assumed continuity!) and so by definition, $O \in \mathcal{T}$, hence $\mathcal{T}' \subseteq \mathcal{T}$ has been shown and $\mathcal{T}$ is maximal as required.
Now if $g: Y \to Z$ is continuous, then $g \circ f$ is continuous as a composition of continuous functions.
Conversely, if $g: Y \to Z$ is a function such that $g \circ f$ is continuous, let $O$ be open in $Z$. Then by the assumed continuity $$(g \circ f)^{-1}[O] = f^{-1}[g^{-1}[O]]$$ is open in $X$ and thus by definition of $\mathcal{T}$ again we have $g^{-1}[O] \in \mathcal{T}$. As $O$ was arbitrary, $g$ is continuous.