Why isn't the initial topology always the trivial topology? If I have a set $X$ and a function $f:X\rightarrow X$, then I think $f$ is continuous with the trivial topology, because no matter what the function is, $f(X)\subseteq X$. Thus for any point $f(x)$, the only neighbourhood of $f(x)$ is $X$, and the preimage of $X$ is $X$ (an open set), so $f$ is continuous at all points. Since the trivial topology is the weakest possible topology, it should be the initial topology for any function or set of functions. I'm pretty sure this is wrong but I don't know where the mistake is.   
I thought maybe an initial topology might be defined as the weakest non-trivial topology that makes a set of functions continuous, but Wikipedia mentions nothing like this. Is this actually true for functions of the form $f:X\rightarrow X$, meaning the initial topology is only interesting on functions $f:X\rightarrow Y$ where $X\neq Y$?
 A: As far as I am aware, you only define an initial topology for a function when the codomain is given as a topological space.  So you could have a function $f: X \to X$, and a particular topology $\tau$ on $X$ (in its role as codomain), and then the corresponding initial topology is the weakest topology $\sigma$ such that $f$ is continuous from $(X, \sigma)$ to $(X, \tau)$.
A: There are two "trivial" topologies on a set $X$: the discrete topology, in which every set is open, and the indiscrete topology in which only $\emptyset$ and $X$ are open. The discrete topology on $X$ makes every function $f : X \to Y$ continuous with respect to any topology on $Y$. Dually, the indiscrete topology on $X$  makes every function $g : Y \to X$ continuous with respect to any topology on $Y$. The discrete (resp. indiscrete) topology on $X$ is the initial (resp. final) topology for the family comprising all functions $f :X \to Y$ where $Y$ ranges over all topological spaces (resp. all functions $g : Y \to X$). Moreover, the analogous statement is true if you restrict $Y$ to range over topologies on $X$, so in that sense your thinking is correct. See https://en.wikipedia.org/wiki/Initial_topology for the definition of initial and final topology defined by a family of functions.
A: I think the problem is that it is not true that if $X$ has the indiscrete topology that every map $f: X \rightarrow Y $ is continuous. You may take, e.g., $X=Y= \mathbb R^2$, with $X$ indiscrete and $Y$ has the "standard" Euclidean topology,  and $f(x)=x^2$. Now consider the $Y-$ open set $V:=(0,4)$. Then $f^{-1}(V)=(-2,2)$, which is not open in $X$ with the indiscrete topology. It is the case, though, as Rob Arctan pointed out, that if we have $f: X \rightarrow Y $ , and $Y$ is indiscrete, then $f$ is continuous.
A: For any map $f: X \rightarrow (Y, \tau_Y)$, we want to find a topology on X so that $f$ is continous. We want $\tau_X$ to be as economic (small) as possible so that $f$ is continous. An idea is the following: $\tau_X = \{f^{-1}(V)$|$V \in \tau_Y\}=:f^*(\tau_Y)$, called the pull-back topology. 
Imagine the opposite situation: $g: (Y,\tau_Y) \rightarrow Z$ and we want to find a suiting topology on Z. Then we look at the push-forward topology $g_*(\tau_Y) :=  \{ W \subseteq Z$ |$g^{-1}(W) \in \tau_{Y}\}$.
Keep in mind that the preimage is compatible with many set operations as union and intersection (what we need for a topology).
General idea: We want $f: (M, \tau_M) \rightarrow (N, \tau_N)$ to be continous.
One option: $\tau_N = \{N, \emptyset\}$ will always make the function continous ($A\subseteq Y$ -> $f^{-1}(A) \subseteq M$)
Other option: $\tau_M = \mathfrak{P}(M)$ ($A\subseteq Y$ -> $f^{-1}(A) \in \mathfrak{P}(M))$.
So, if $f$ is not continous, but you want it to be, you have two options: enlarge $\tau_M$ or make $\tau_N$ smaller. Continouity is the right balance between those two aspects.
Hope that the last point helped in developing an intuition.
