A post-doc colleague showed me this picture and said: going from the diagram No.2 to No.3 and to No.4 is taking the homology.
I did not quite understand this comment. For me, if I take simplicial homology as an example, homology is setting up a simplicial chain complex and then forming the quotient groups of cycles modulo boundaries.
I can see that in a certain way the diagrams 2-4 are related to the idea of forming the quotient, or I should say they show "modding out" the boundaries in some sense.
My question, are these diagrams actually more metaphorical (a good visual to support memory), or are they in fact quite rigorous examples that could easily be formalized? I have tried but could not rigorously formalize what I see in the diagrams.
Any help would be greatly appreciated!

This is rigorous; the loop described by image $(1)$ is homologous to the "loop" described by image $(4)$ in the singular homology of $X:=\Bbb R^2\setminus\{0\}$ and we could convert the diagrams into a formal proof of this (taking as a given that there exist continuous paths that "look like" those pictures).
To pass from $(1)$ to $(2)$, you observe that the loops there are path-homotopic thus homologous. Why? A based homotopy is of those two loop is a continuous $H:I\times I\to X$. By partitioning $I\times I$ into two copies of $\Delta^2$ along the diagonal, restricting $H$ gives two simplices (of the singular simplicial set of $X$) $a,b:\Delta^2\to X$ where $b$ has been chosen so that its diagonal is oppositely oriented to $a$. $a+b$ is an element of $C_2$ whose formal boundary is the sum $f-g+u-v=f-g$ where $f,g:\Delta^1\to X$ are parametrisations of our loop and $u,v$ are the constant maps to the loop basepoint, so in fact $u=v$ and these cancel in the space of formal linear combinations that is $C_1$. Therefore, $f-g$ is a boundary element of $C_1$ (it is in the image of the formal boundary operator $C_2\to C_1$); it follows that $f=g+(f-g)$ is equivalent to $g$ in the first singular homology group. That gives us power to say $(1)$ is homologous to $(2)$.
To figure out $(2)\to(4)$ we first need to note that if $f:x\to y,g:y\to z$ are paths in $X$ then the ($1$-simplex represented by the) path composite $gf$ is homologous to the formal sum $f+g$. This is true just because there's a hollow triangle with edges $f,g,gf$ and we can easily extend this to a $2$-simplex (without needing "more points", so there is no issue with crossing zero etc.); just take $\Delta^2\twoheadrightarrow\Delta^1\overset{gf}{\longrightarrow}X$ where the first arrow projects onto the relevant edge.
So we can decompose $(2)$ as homologous to the formal sum of every "piece", seeing it as a piecewise function. In $(3)$, a triangle is drawn and shaded at the bottom; two of its edges are "pieces" from $(2)$. The triangle is a pictorial representation of the fact there is a continuous $\Delta^2\to X$ whose formal boundary equals $a+b-c$ in:
$a+b-c$ is then a boundary element of $C_1$, so subtracting this from the $1$-simplex representing our loop from $(2)$ doesn't change its homology; and, $(2)$ is just (homologous to) a formal sum of (the other pieces) with $a$ and $b$. The homologous result of this subtraction is (by reattaching all the "pieces") then homologous to $(3.5)$:
Which is just $(2)$ with the edges $a$ and $b$ "cancelled out" and replaced with $c$. The main point is that it is rigorous to perform this cancellation when working modulo boundaries.
Now, this is homologous to $(4)$ + the $1$-simplex representing walking around the edges of the shaded square. By similar reasoning - following the shaded diagram - or by noting this last loop is nullhomotopic in $X$, this $1$-simplex is homologous with zero. Therefore, it is rigorous to say $(1)$ is homologous to $(2)$ is homologous to $(4)$, taking certain basics as a given.