You have the right idea insofar as the broader question is concerned: if $\lim f(x) \ne 0$, you get a contradiction, but that in itself supposes the limit exists, so we have to seek some function where it doesn't if we want a counterexample.
The "tent" ideas there displayed algebraically, in the linked question, somewhat obfuscate what's going on. Consider the thought process for how such an example might be constructed, and why they are arguably one of the simplest examples to construct:
"Okay, so I know to get a counterexample, I need to have the limit not exist. So I need some sort of oscillatory behavior."
"For this to be a good and convincing counterexample, I should keep things simple. Triangular 'bumps' are easy to calculate the area of, and hence the integral over." (This is especially easy to rationalize since a number of counterexamples use similar ideas; exposure is nice.)
"Clearly, a bunch of triangular waves of equal - or better, even growing - heights form a convincing argument for the nonexistence of the limit. Of course, the function should be zero outside of these triangles."
"Of course, I want the area of the triangles, as I go to infinity, to converge. To make this convincing, I could construct the triangles to have areas in geometric progression: $1, 1/2, 1/4, 1/8$, and so on."
From there, you can fiddle around algebraically to find the algebraic description of a suitable function.
If you want the $n$th triangular bump to have area $1/2^n$, then you can let it have height $1$ and base length $1/2^{n-1}$. This would work for a constant height example; you can also have height $2^{n}$ and base $1/2^{2n-1}$, or some other such construct, for variable but increasing height.
Clearly the bases will be approaching zero length very fast, so you can choose points $x$ to serve as the "center" of the base, and make them, say, two or three units apart.
Then you can create an equation from the point at the desired height above each center, down to the base on either side, which describes your triangular bump, and define the rest of the function to be zero.
That would give you the algebraic description. In the end, it will look rather obtuse and people a little new to the subject will wonder "where in the hell did that come from" -- but it is, nonetheless, motivated geometrically with very basic ideas in mind.
I thought of some kind of function making a building at each odd integer but the width of the "stair" is quickly decreasing something like $2^{-k}$ for every odd integer $k$ (and $0$ for $x<0$). Is my function right ?
It can be made to work in a similar vein to the previous triangular spike idea, yes. The areas of these rectangles, assuming unit height, will approach $1$ or $2$ in the end, by use of the geometric series. (Which it is depends on whether $k=0$ is permissible, essentially.) However, the behavior ensures that the limit is nonzero (since there is always eventually another "jump up" to make the rectangle, eventually).
One way you could frame it algebraically is with the indicator function,
$$\mathbf{1}_A(x) = \begin{cases}
1 & x \in A \\
0 & x \not \in A
\end{cases}$$
Define a succession of sets $S_k$ (for $k \in \mathbb{Z}_{\ge 1}$) by the rule that
$$S_k = \left[ 2k+1 \;,\; 2k+1+\frac{1}{2^k} \right)$$
Then your function is
$$f(x) = \sum_{i=1}^\infty \mathbf{1}_{S_i}(x)$$
The details about $\int_\mathbb{R} f(x) \, \mathrm{d}x$ and $\lim f(x) \ne 0$ I leave for you to formulate to whatever degree of precision you desire.
So in the end, arguably, perhaps a simpler example after all, at least where the algebraic description is concerned. However, I do want the takeaway to not be that your answer is "significantly simpler", but rather - hopefully - you see how yours is motivated by similar ideas in the end as to the others in the linked question.
Namely: that in the question body:

Or Cookie's triangular spikes:

Or your own example:

Or, for the daring, bjorn93's suggestion of the Fresnel integral:
