Genius mathematicians who never published anything
Solution 1:
There are influential posthumous papers by authors who did not publish them.
Galois had an immense influence on algebra because of the publication of something he wrote the night before he died in a duel. He gave us the word "group".
Thomas Bayes had an influential posthumous paper in which he found the conditional probability distribution of a random variable $P$ whose marginal distribution is uniform on $[0,1]$, given the observation of the number of successes in $n$ trials that are conditionally independent given $P$, where the conditional probability of success on each trial, given $P$, is $P$. He did publish things while he lived.
Mary Cartwright never published her proof of the irrationality of $\pi$. A question she set on an examination was to fill in its details. We know of it only because Sir Harold Jeffries included it in an appendix in one edition (and not in other editions) of one of his books, and he leaves the impression that he knew of it only because of its occurrence on that examination.
Solution 2:
The words "never" and "anything" are somewhat restrictive (and we know that absolute statements are always wrong). Nowadays, you can't be recognized at all when you're not publishing. Additionally, the term "Genius" is hard to define...
One person came to my mind is Grigori Yakovlevich Perelman. He hardly published anything, did not even defend his dissertation, and was one of the few leading researchers at his institute who only was a "PhD candidate". Of course, strictly speaking, he did publish something, particularly his proof of a generalization of the Poincaré conjecture. But this was not published in some mathematical Journal, but only on arXiv.
I think that someone who casually finds a proof for a generalization of a conjecture that dozens of mathematicians had been working on for 98 years, and doesn't give a ... care about the formal process of scientific publications qualifies as a genius, and is close enough to "never publishing anything" to be mentioned here, at least...
Solution 3:
Riemann published but 15 papers in his lifetime. One of my professors once told me, perhaps apocryphally, that one of those papers contained an error, and that his distress over the error led him to poor health and eventually his death.
After his death, his housekeeper "cleaned up" his papers, losing who knows how many of his mathematical ideas forever.
Solution 4:
Pierre de Fermat-Some of his works and theorems were published by his son. His works, including Fermat's last theorem $(a^n+b^n\neq c^n \,\forall n>3,a,b,c,n\in\mathbb{Z})$ were not published until his death.