In LaTeX, the not-equal symbol is a commonly used mathematical operator, typically represented by the \neq command. The inequality commands are part of the inequality symbol family alongside \le and \ge, which represent less than or equal to and greater than or equal to, respectively. The symbols can be grouped into the Binary Operation/Relation Symbols category.
Some symbols require the amssymb package, which adds more mathematical symbols to the LaTeX repertoire. As with other similar operators, the not-equal operator must be used inside of a math environment (as defined by $ ... $).
The \not-based alternative
Sometimes the default rendering is unsatisfactory. In such cases, we have to construct variants that negate a particular symbol using the \not prefix, combined with another symbol. The easiest way to achieve this is to use \not on an equality symbol, e.g., \not=, which results in the negated equal sign.
However, this doesn’t always work, because \not may not scale correctly depending on what it’s negating. For example, we might try applying \not to the empty set symbol, \varnothing, as follows:
$$\not\varnothing$$
But in doing so, we get a rather strange-looking result:
$$\not\varnothing$$
Instead, the correct technique is to use something like \not\varnothing. In this example, \not is applied to the empty set symbol so the slash slope matches the style that would appear if you rendered a “not equal” operator, where one line is crossed out.
This was discussed in detail on TeX Stack Exchange.
A known bug
I know of one bug involving the \neq command; however, I discovered it when working with an application called a markdown notebook app. It uses LaTeX to render equations, but some versions of its renderer have a known bug. Version 3.0.12 (on Windows 10) used Electron 29.3.1, and there was a problem in how it rendered LaTeX math environments.
For example, the code $$\neq$$ renders the same as the equal sign =.
I confirmed that this issue wasn’t caused by anything else — for instance, it could display LaTeX in code blocks and plain text just fine. So it must have been a specific problem when rendering a LaTeX math equation.
It didn’t seem to care whether we used the LaTeX syntax ($$…$$), or whether we used their inline math notation ($…$). Regardless, both failed to produce an image of the “not equal” symbol.
Zooming browser window
One of the things that people use Overleaf for is to test out different rendering styles. Because Overleaf is web-based, though, I tend to look at it in my preferred browser zoomed out to 75% or so. When I did that, I noticed that the equal sign appeared to have only one visible line.
Overleaf in-browser use
Equal sign appeared with one lighter line
I then realized that the equal sign had actually two lines, with one being slightly darker than the other. However, since I’m looking at the page at 75% zoom, the darker line appeared heavier than the lighter one.
It’s possible that someone could argue that this was a true LaTeX error, but I think that the browser is rendering the equal sign with a single line, while the rest of the document appears to be fine.